Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lharper
New Member

Calculate Percentages on Bar Chart

Hello, 

I have some demographic data and I am creating bar charts. The dataset is one row per respondant. I'd like to display both the number of and percentage of respondants for each race category in the bar chart, like in the example below (generated in Tableau). I have seen solutions for creating stacked column and line charts as a workaround, but the percentages do not display well on the smallest categories. 

 

Any solutions for easily displaying displaying percentages? It does not necessarily need to be in the bar chart format, though that is preferable. 

 

lharper_0-1686767032939.png

 

1 ACCEPTED SOLUTION
ray_aramburo
Super User
Super User

Bar charts and column charts by default can't include percentages in the labels but a workaround that may work is the next one.

Create a measure like this:

Label= CONCATENATE(CONVERT([MeasureThatGetsTotals], STRING), " (" & CONVERT([MeasureThatGets%Total],STRING) & ")")
 
Then, turn on the Data Labels, in Values turn on Custom label and drag & drop the created Label measure there.
ray_aramburo_0-1686768080968.png

 





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
ray_aramburo
Super User
Super User

Bar charts and column charts by default can't include percentages in the labels but a workaround that may work is the next one.

Create a measure like this:

Label= CONCATENATE(CONVERT([MeasureThatGetsTotals], STRING), " (" & CONVERT([MeasureThatGets%Total],STRING) & ")")
 
Then, turn on the Data Labels, in Values turn on Custom label and drag & drop the created Label measure there.
ray_aramburo_0-1686768080968.png

 





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.