Multiple labels on bar chart

Multiple labels on bar chart

I’m building a “dashboard” in SSRS that updates every minute to show the results of a particular horse race. One area on the page displays a bar chart as below.

20141028_multiple_labels_2

I needed to display the number as a data label (which was simple enough) but I further needed to show the percentage of the total in the same label. To achieve this you need to first right click the series in your chart and select Show Data Labels before clicking Series Label Properties.

20141028_multiple_labels_3

Now write a custom expression for the label data, adding the field and the percentage calculation as you need. The screenshot below shows my expression which includes formatting the first number to have a thousands comma and the second number calculated against another dataset, rounded to two decimal places, multiplied by 100 with a % symbol to represent percent of total.

20141028_multiple_labels_1

=CSTR(FORMAT(Fields.thecount.Value,"#,#"))
 & " ("
 & ROUND(Fields!thecount.Value 
   / SUM(Fields!s_metric1.Value, "DataSet2"),2)*100
 & "%)"

I hope this helps!

Mike250

I'm an Australian Chief Analytics Officer passionate about data science, visual insights, and all things sportโ€”particularly cricket. An adventurer at heart, Iโ€™ve gone from abseiling cliffs to snorkeling in crystal-clear waters, sleeping in the wilds of Africa, and exploring destinations worldwide, with my latest trip taking me to Bali. When I'm not diving into data or analytics, I'm spending time with my three sons and two daughters, attempting to hit sixes for my local cricket club, reviewing chicken schnitzels or honing my craft around a coffee machine.

Related Posts
Leave a comment

Your email address will not be published. Required fields are marked *