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
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
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.