I have a pie chart in SSRS. It contains many categories so it is kinda hard to read. What I would like to do is include the category AND the percent in the label, but I am not sure how to do this.
You can include the category by setting the label to [CategoryName]
(this is the default).
You can include the percent by changing that to #PERCENT
.
But I cannot seam to figure out how to include both.
Is there a VBA formula that I can add that will give me both?
You can actually just shove #PERCENT
into a larger string.
Some simple data:
And a simple chart based on this:
The expression used for the labels is:
=Fields!grp.Value & ": " & "#PERCENT{P2}"
Here {P2}
is controlling the formatting. You should be able to adapt to your scenario.
Alternatively, for greater control you can just add the relevant % calculation in the label expression; in the above case this would be:
=Fields!grp.Value
& ": "
& Format(Sum(Fields!val.Value) / Sum(Fields!val.Value, "MyDataSet"), "P2")
Which in this case gives identical results to the above.