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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.