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

Tingo picture Tingo · Dec 27, 2013 · Viewed 8k times · Source

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.

Answer

Tingo picture Tingo · Dec 27, 2013

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.