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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Amanda_CIIS
New Member

How do I set up a data label in a stacked bar graph to calculate based on bar total?

Hello, I am new to Power BI and tried to look for existing posts with a similar situation but wasn't able to find a solution that worked for me, so I'm hoping someone here will have a solution!

 

I have this stacked bar graph that is categorized based on three degree levels, with each bar representing one year. I would like the data label to be calculated based on the percentage of degrees in that level based on the year (so the percentage of each color in that bar), but I can only calculate the percentage of degrees based on the grand total. I understand I can calculate percentage based on bar total if I use a 100% stacked bar graph, but I want to show the difference in total degrees awarded across the five years.

 

Amanda_CIIS_0-1691786983995.png

Thank you in advance!

4 REPLIES 4
datawailor
Advocate II
Advocate II

This sounds like you want to calculate the % total across 5 years instead of each year? Is that correct? (Just trying to understand the question)

Ah sorry for being unclear, I mean the opposite, I would like to calculate % total over each year, not all 5 years.

Ashish_Mathur
Super User
Super User

Hi,

Share data in a format that can be pasted in an MS Excel file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello, I'm sorry but I can't share the data file for privacy reasons. What I can do is include the data numbers in this format:

 

Below is the same chart with the number of each degree level (color) and the total at the end of the bar (year). So, I'm hoping to set up the data label as % degree level of the year. Here's a table that shows the calculation I want to display.

 

 DocMastUG
2017-1895/372=25.5%227/372=61%50/372=13.4%
2018-1991/347=26.2%222/347=64%34/347=9.7%
2019-20122/392=31.1%231/392=58.9%39/392=9.9%
2020-21118/444=26.6%253/444=57%73/444=16.4%
2021-2259/335=17.6%221/335=66%55/335=16.4%

 

Amanda_CIIS_0-1692047670226.png

 

Please let me know if you have any other questions I can clarify, and thank you for your help.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors