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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello,
I have this dataset, and need to calculate the subcategory weight over the category (not over the total).
So that the sum of the subcategories gives me 100%
When I am in Category row, I want to show the Category weight over total amount (p.e. 47% in Category 1) and when I am in subcategory row, I want to show the subcategory weight over the category amount.
For example:
Thank u very much
Solved! Go to Solution.
Hi,
Please check the below picture and tha attached pbix file.
It is for creating measures.
Percentage measure: =
VAR _categorytotal =
CALCULATE ( [Value total:], ALL ( Category[Subcategory] ) )
VAR _alltotal =
CALCULATE ( [Value total:], ALL () )
RETURN
SWITCH (
TRUE (),
ISINSCOPE ( Category[Subcategory] ), DIVIDE ( [Value total:], _categorytotal ),
ISINSCOPE ( Category[Category] ), DIVIDE ( _categorytotal, _alltotal ),
DIVIDE ( _categorytotal, _alltotal )
)
Hi,
Please check the below picture and tha attached pbix file.
It is for creating measures.
Percentage measure: =
VAR _categorytotal =
CALCULATE ( [Value total:], ALL ( Category[Subcategory] ) )
VAR _alltotal =
CALCULATE ( [Value total:], ALL () )
RETURN
SWITCH (
TRUE (),
ISINSCOPE ( Category[Subcategory] ), DIVIDE ( [Value total:], _categorytotal ),
ISINSCOPE ( Category[Category] ), DIVIDE ( _categorytotal, _alltotal ),
DIVIDE ( _categorytotal, _alltotal )
)
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
7 | |
5 | |
4 | |
3 |
User | Count |
---|---|
12 | |
11 | |
10 | |
9 | |
8 |