# Format Y axis label as percentage

• ### Question

• I have entered the code as P0 when formatting my Y axis to show 0% to 100%. This showed me percent values as 0% to 10,000%. Then after reading the forums I put the major gridline interval as 0.2 to get jumps of 20% but this just puts a lot of lines on the chart as 0,0.2,0.4 till 10,000%.

How can i fix this one ..

Thanks

Kiran

Monday, August 6, 2007 8:00 PM

### All replies

 I have entered the code as P0 when formatting my Y axis to show 0% to 100%. This showed me percent values as 0% to 10,000%. Then after reading the forums I put the major gridline interval as 0.2 to get jumps of 20% but this just puts a lot of lines on the chart as 0,0.2,0.4 till 10,000%.   How can i fix this one ..   Thanks Kiran

Have you set the minimum value on the scale to zero and the maximum value on the scale of the Y-axis to 100?

Monday, August 6, 2007 8:04 PM
•

Yes I have done so. I have tried removing that too

No luck

Monday, August 6, 2007 8:36 PM
• Possibly the issue is your data. What is the maximum value of your data? Have you divided this into your field?

For example, if you try to display change as a fraction of a dollar:

Then one penny should be 1% of a dollar. To get 1%, you take 1/100 = .01 (1%)

If you didn't divide by 100, however, then one penny would be 1.00 (100%).

A dime would be 1000% and so on.

One dollar would be BEHOLD 10000% (There's that 10000 percent).

Most likely you have just put the field as raw data, not as a percentage and expected the format expression to do the division for you.

Try dividing by 100!!!!

Monday, August 6, 2007 8:58 PM
•

I have got a stacked chart and on the data fields I have put in 2 fields

% received and % latewhic combine together to give 100%.

The data points is actuallys et to give teh actual counts of these fields.

So would this count as raw data?

If I divide this percentage number by 100 it goes really small on the graph but the scale remains the same. How can I modify the scale.

I appreciate the time.

Kiran

Monday, August 6, 2007 9:05 PM
• Oh I thought you were saying your data was going to 10,000%. Try changing your Y-scale to a minimum of zero and maximum of 1.

Monday, August 6, 2007 9:59 PM
•

Thanks for the replies.

I have tried that possibility too. This option is successfull in creating the axis from 1% to 100% but the data itself goes wrong. There is no split between the received and late numbers and its either 100% received or 100% late. I dont know why it does that. My assumption is that since maximum value of 1 is specified only the first 1% of the data is displayed.

Kiran

Tuesday, August 7, 2007 1:05 PM
• Hi,

Is there a solution for this problem ?

I have exactly the same problem.

Minimum = 0 and max = 100 doesn't work.

Min = 0 and Max = 1 doesn't work.

Kind regards,

fix
Tuesday, February 10, 2009 1:21 PM
• There are a few things that could be the issue here.  The first is that if you are using a 100% stacked bar chart, or any chart for that matter, your dataset needs to be in the following format.  Let's assume you want to have a set of stacked bars for each month.

Month, Measure, Value
1,    PercentLateWhic, .55
2, PercentLateWhic. .64

etc.

In short, the Measure field is placed on the series grouping, and the chart will create the series for you.  You can't have a rowset where these two values are in different fields.  The values all need to be in the same "column"

The second thing that could be the issue here is that format code P0 doesn't actually calculate percentages for you as previous posters indicated.  P0 just takes the value you give it and multiplies it by 100 and adds a % symbol to it.

If you are using a 100% stacked bar chart, when the chart figures out the "values" for each stack, it is not done along the category groups.  It is instead done along the total of the series.  As such, it works for the pie charts really well because they only have one series, but for a 100% stacked column chart you don't see the same effect.

To get what I think you want, you need to do the following.

Set the Data Expression to this =SUM(Fields!YourField.Value) / SUM(Fields!yourField.Value, "Chart1_CategoryGroup1")  where Chart1_CategoryGroup1 is the name of the group on the category.

Next, you will need to go into the property grid.  If you are using Report Builder 2.0, you can enable the property grid via the View Tab.  Find the data point label format, set it to 0.00\%.  Keep the property UseValueAsLabel set to True.  Note that if you try to do this in the property pages it will not persist due to a bug so you need to do it in the property grid.

I've uploaded a sample 2008 RDL file here with the solution.  http://cid-209305deacf224d0.skydrive.live.com/self.aspx/SQL%20Server%20Reporting%20Services%20Forum/100%20Percent%20Stacked%20Bar.rdl

This example requires SSRS 2008.  If you are using SSRS 2005, let me know and we'll see if we can come up with a similar solution for this scenario.  That said, I would agree that this scenario should be easier to do and we'll look into how we can address it for future releases. Great question!

-Sean

Program Manager, SQL Server Reporting Services
• Proposed as answer by Wednesday, February 11, 2009 1:13 PM
Tuesday, February 10, 2009 7:48 PM
• Thanks you.
I will take it tonight (Just to see your example).
But as your explanation was really clear I was able to modify my axis.

Kind regards,

fix
Wednesday, February 11, 2009 1:19 PM
• This is an old thread, but the following format ended up working for me (in asp.Net charts, haven't tried SSRS:

0.\%

This annoyed the heck out of me.  Most of the the percent labels are calculated for you in the stacked column chart. The default Y axis label goes from 0 to 100 without including a percent sign, but for some reason internally, it stores the 100 as 100 and not a 1 (100%).
• Proposed as answer by Tuesday, June 7, 2011 6:43 PM
Tuesday, June 7, 2011 6:43 PM
• At the number formatting option, don't choose as "Percentage". Choose "Custom" instead, and use this custom format (without the quotes): "0\%".
• Proposed as answer by Tuesday, March 24, 2015 9:57 AM
Wednesday, June 13, 2012 7:31 AM
• If you want decimals, please give 0.00\% as custom number format for that axis.
Thursday, June 5, 2014 9:59 AM
• Perfect..!!! Its working for me. Thanks..!!
Tuesday, March 24, 2015 9:58 AM
• 9 years later and this well known, well-documented bug is still in SSRS.

The Percentage functionality doesn't work correctly. You STILL must use a custom format  0\%

Microsoft SUX.

• Proposed as answer by Thursday, March 3, 2016 7:38 PM
• Edited by Thursday, March 3, 2016 7:40 PM added answer and microsoft still sux
Thursday, March 3, 2016 7:38 PM
• Yeah, we all know they SUX but you really ROCK!!!
Thank you Irawan for this trick, that bothers me 2 days!!!
:-)

allan

• Edited by Thursday, July 14, 2016 2:22 PM
Thursday, July 14, 2016 2:14 PM