Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi Power BI Experts,
For readability, i am showing two out of six bar charts in the graph below. The issue is that the bars do not add up to 100% in its respective category. For example, Dashboards NOW equals ~16%.
I am using this DAX code to calculate the percentage.
I would like for each bar chart to look like this.
If I add more than one category, the percent is the grand total of both graphs and that is not what I want.
Any help is greatly appreciated.
Luis
Solved! Go to Solution.
Hmm. That seems strange to me but it's often hard to debug just by looking at screenshots.
Here's a variation that might be slightly more robust:
Before and After % of Row Total =
COUNT ( 'Before and After'[Progress Rating] )
/ CALCULATE (
COUNT ( 'Before and After'[Progress Rating] ),
ALL ( 'Before and After' ),
VALUES ( 'Before and After'[Progress Category] )
)
This removes all filters on that table then restores the category filter. Try ALLSELECTED instead of ALL if you want to want to preserve filters from outside the visual other than category.
Success!
Thank you.
Which book or course did you get your DAX skills?
I would like to upskill my DAX proficiency.
Thank you for all of your guidance.
I've acquired my DAX skills through years of answering questions like yours and reading articles on sqlbi.com and radacad.com. Both of those sites have training videos too and I have done some of the SQLBI Courses.
Using ALL, removes all the filter context on the table but you only want to remove part of it.
Try just removing the filter context for the Legend field:
Before and After % of Row Total =
COUNT ( 'Before and After'[Progress Rating] )
/ CALCULATE (
COUNT ( 'Before and After'[Progress Rating] ),
ALL ( 'Before and After'[Progress Rating] )
)
Thank you Alexis,
I am getting closer. Using the DAX, the bars stretch out to 100% by rating category. However, I would like a percentage for each rating category. All the bars for the respective category would sum up to 100% like the built-in function.
Would you mind providing another friendly nudge?
Hmm. That seems strange to me but it's often hard to debug just by looking at screenshots.
Here's a variation that might be slightly more robust:
Before and After % of Row Total =
COUNT ( 'Before and After'[Progress Rating] )
/ CALCULATE (
COUNT ( 'Before and After'[Progress Rating] ),
ALL ( 'Before and After' ),
VALUES ( 'Before and After'[Progress Category] )
)
This removes all filters on that table then restores the category filter. Try ALLSELECTED instead of ALL if you want to want to preserve filters from outside the visual other than category.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |