Pie Chart Labels
Any way to change a Pie Chart (SQL is the one I'm using) labels from Counts to Percentages?
Thx!
Best Answer
-
Shane_White Cireson Support Super IT Monkey ✭✭✭✭✭
Here is an SQL Query I did as an example of All Workitems by Status but shown as a percentage, let me know what you think:
SELECT ds.DisplayString AS Status, FORMAT(Round(count(*) * 100.0 / sum(count(*)) over(), 2),'N','en-gb') + '%' AS [Percentage]
from dbo.WorkItem as wi
JOIN dbo.DisplayString as ds
ON ds.ElementID = wi.StatusId
AND ds.LocaleID = 'ENU'
Group BY ds.DisplayString
Thanks,
Shane
6
Answers
Hi @Brian_Winter
Here is an SQL Query I did as an example of All Workitems by Status but shown as a percentage, let me know what you think:
SELECT ds.DisplayString AS Status, FORMAT(Round(count(*) * 100.0 / sum(count(*)) over(), 2),'N','en-gb') + '%' AS [Percentage]
from dbo.WorkItem as wi
JOIN dbo.DisplayString as ds
ON ds.ElementID = wi.StatusId
AND ds.LocaleID = 'ENU'
Group BY ds.DisplayString
Thanks,
Shane
Yep, that's exactly what I had to do. I created a second query with a second visual. The first has the raw count and the second shows percentages. I couldn't find a way to combine the two.
Brilliant Minds....!
Great minds think alike indeed!! 😉