Tingo
Tingo

Reputation: 482

SSRS Stacked Column Chart - Label Data As A Percent of the Stack

If I want to then display each series' value as a percentage of the stack, how would I achieve this? If I use #PERCENT for the data labels, it gives me a percent of that series instead of a percent of that category (month). It seems like this should be a simple thing to do (percentage of the whole stack), but I haven't been able to make it work. If my data looks like this:

Month      Prod1| Prod2| Prod3
-----------------------------
January  |  5   |   5  | 5 
February |  10  |   15 | 10
March    |  10  |   0  | 20

What I am experiencing when I use #PERCENT is that the label for January/Prod1 is 20% (5 / (5 + 10 + 10)). What I want to display is 33% (5 / (5 + 5 + 5)) since January/Prod1 is 33% of the total products shipped in January.

Upvotes: 2

Views: 9086

Answers (3)

justine ramos
justine ramos

Reputation: 171

You can use the second expression for the Percentage. But for better data presentation, I prefer to show both Count and Percentage.

=CSTR(FORMAT(Fields!Val1.Value,"#,#")) & 
" ("& ROUND(SUM(Fields!Val1.Value)/(SUM(Fields!Val1.Value)+SUM(Fields!Val2.Value))*100)
    & "%)"

Here is my image

Upvotes: 0

Deepak Dharmpurikar
Deepak Dharmpurikar

Reputation: 21

Simple answer would Select chart series label and in Misc section of Properties change Format as ##.##'%'

Upvotes: 2

Tingo
Tingo

Reputation: 482

Of course, after a day of work I only solve my problem AFTER posting it to SO.

I found that I can use the following expression for the data labels to acheive this:

=Fields!series_value.Value/Sum(Fields!series_value.Value,"Chart7_CategoryGroupTotal"))

I just have to use the value of the specific series, divided by the total of these series values within the category scope.

Upvotes: 5

Related Questions