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
Anonymous
Not applicable

Is there an easy way to get stacked barcharts to show total and percentage?

Hi all,

 

My visual has a stacked bar chart and it is currently set to show the total amounts per category, with a data label on the inside centre showing this breakdown. What I want to do is add a percentage label on the end of these bars to give me an overall percentage of the total. 

 

e.g. if the total was 100,000 and

Bar 1 had a split of 10,000 + 20,000 then I would want this to show 30% at the end, and

Bar 2 had a split of 50,000 + 20,000 then I would want this to shpow 70% at the end.

 

I think I'll have to create measures and stick card visuals on the end to achieve this but wanted to check if there is an easier way to do this at all?

Thank you

 

EDIT: I am currently using a stacked bar chart (not column) and therefore i dont think there is a combo chart option. I'm not using the column option as the Y axis has labels which are longer, so would not look as tidy as I would want.

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

Based on your description, I would suggest you to create a 'Line and stacked column chart' to display it. Single stacked bar chart or clustered column chart could not meet your requirement which only has one Y-axis.

Create a measure like this to calculate percentage:

Percent =
SUM ( 'Table'[value] ) / CALCULATE ( SUM ( 'Table'[value] ), ALL ( 'Table' ) )

re.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

Based on your description, I would suggest you to create a 'Line and stacked column chart' to display it. Single stacked bar chart or clustered column chart could not meet your requirement which only has one Y-axis.

Create a measure like this to calculate percentage:

Percent =
SUM ( 'Table'[value] ) / CALCULATE ( SUM ( 'Table'[value] ), ALL ( 'Table' ) )

re.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@Anonymous , You can create a measure and use a stacked line visual. with line color same as background-color

 

Example to show label, not %

https://radacad.com/showing-the-total-value-in-stacked-column-chart-in-power-bi

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.