Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hey, I would like to create a Stacked Bar Chart showing in total 100% values and it can be grouped by several categories. I saw it in the following video:
https://www.youtube.com/watch?v=-nqEv2YXLsU
I got it running for one specfic category with the following measure:
Cost % of Total = DIVIDE (
[Cost Amount],
CALCULATE ( SUM ( 'Usage details'[Cost] ), ALLEXCEPT ( 'Usage details', 'Usage details'[MeterCategory] ) )
)But now having the Parameter slicers where I can switch the categories to something else, this solution doesn't work anymore. Is there any way to keep the Stacked bar chart with at the end 100% as total value but with different grouping from other fields in the table 'Usage details'?
@lkshck , Switch measure based on selection
refer the code here , i switched it for topn
Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |