The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello everyone,
We've successfully obtained the "Percent of Column Total" results in the Matrix visualization. Now, I'm looking to replicate the same outcome in a bar chart. Despite attempting various DAX queries, I haven't been able to achieve the desired results.
Note: I am using Clustered bar chart
Apps,Spent time_bucket_hr , viewers
a 0-2 60
b 2-4 70
a 2-4 130
b 0-2 40
Example:
Thanks in advance.
Please help me to fix the issue
Solved! Go to Solution.
Hi @Raj341
You can try this measure.
Measure = DIVIDE(SUM('Table'[viewers]),CALCULATE(SUM('Table'[viewers]),ALLSELECTED('Table'[Apps])))
Your current measure uses ALL('Sheet1'), this will remove all filters on table 'Sheet1', which finally gives you the percent of grand total. To have the percent of column total, you need to remove filters on the column field.
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
just mantain the classic visualization ..and you will get it.
the fancy new one is not allowing it .
Hi @Raj341
You can try this measure.
Measure = DIVIDE(SUM('Table'[viewers]),CALCULATE(SUM('Table'[viewers]),ALLSELECTED('Table'[Apps])))
Your current measure uses ALL('Sheet1'), this will remove all filters on table 'Sheet1', which finally gives you the percent of grand total. To have the percent of column total, you need to remove filters on the column field.
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
Thankyou for sharing the logic.
I am using wrong Dimesion, based on your screenshot. I realized my mistake.
-Thanks a lot for sharing the logic
@Raj341 , The measure formula is correct. You can use allselected in place of all, so the other filter can pass.
You can enable the label to show it on visually.
You can use this new measure as label details to show both labels
New Power BI Data Label Customizations (December 2023) - Enhance Your Data Analysis & Reporting:
https://www.youtube.com/watch?v=qe3eW4OkAN8&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
Thankyou for sharing the useful link to dive into more granularity 🙂
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
80 | |
66 | |
53 | |
52 |
User | Count |
---|---|
121 | |
117 | |
77 | |
64 | |
63 |