Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I'm using decomposition tree and I want so show off both the value and the percentage. Is it possible?
Additionally, I'm branching it based on a measure, then country, then manufacturer etc. For the percentages, lets say I have manufacturer A with 75 products mark C, and manufacturer B with 25 products mark C. Total si 100 products mark C and I want percentages based on that for every column I have.
Solved! Go to Solution.
Please try this:
Here I create a set of sample:
Then add a measure:
MEASURE =
VAR _currentMark =
SELECTEDVALUE ( 'Table'[product mark] )
VAR _result =
SUM ( 'Table'[Revenue] )
/ SUMX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[product mark] = _currentMark ),
'Table'[Revenue]
)
RETURN
IF (
HASONEVALUE ( 'Table'[product mark] ),
_result,
SUM ( 'Table'[Revenue] ) / SUMX ( ALLSELECTED ( 'Table' ), 'Table'[Revenue] )
)
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please try this:
Here I create a set of sample:
Then add a measure:
MEASURE =
VAR _currentMark =
SELECTEDVALUE ( 'Table'[product mark] )
VAR _result =
SUM ( 'Table'[Revenue] )
/ SUMX (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[product mark] = _currentMark ),
'Table'[Revenue]
)
RETURN
IF (
HASONEVALUE ( 'Table'[product mark] ),
_result,
SUM ( 'Table'[Revenue] ) / SUMX ( ALLSELECTED ( 'Table' ), 'Table'[Revenue] )
)
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @AntonioPetak ,
Since the Decomposition Tree does not natively support showing both the absolute values and percentages, you can achieve this by creating custom DAX measures that calculate and display them together.
Since percentages should be calculated at each level dynamically, use the following measure:
Percentage_of_Total =
VAR CurrentValue = SUM('Table'[Product_Count])
VAR TotalValue = CALCULATE(SUM('Table'[Product_Count]), ALL('Table'))
RETURN
DIVIDE(CurrentValue, TotalValue, 0)
Since the Decomposition Tree only allows one numeric value, concatenate the value and percentage into a string:
Value_Percentage =
VAR CurrentValue = SUM('Table'[Product_Count])
VAR ParentValue = CALCULATE(SUM('Table'[Product_Count]), ALLEXCEPT('Table', 'Table'[Manufacturer]))
VAR Percentage = DIVIDE(CurrentValue, ParentValue, 0)
RETURN
FORMAT(CurrentValue, "#,##0") & " (" & FORMAT(Percentage, "0%") & ")"
The "Analyze" field requires a number, I can't put a string value inside.
Hi @AntonioPetak ,
Unfortunately, Power BI’s Decomposition Tree visual does not support displaying both value and percentage together by default. However, there is a workaround to achieve this. Since the Decomposition Tree only allows showing a single numeric value, you can create a measure that concatenates both the actual value and the percentage as a text label.
For example:
TotalProducts = CALCULATE(SUM(YourTable[Product Count]), ALL(YourTable)) And Percentage Calculation:
Percentage =
VAR CurrentCount = SUM(YourTable[Product Count])
VAR TotalCount = [TotalProducts]
RETURN
DIVIDE(CurrentCount, TotalCount, 0)And Combine these values:
ValueAndPercentage =
VAR CurrentCount = SUM(YourTable[Product Count])
VAR Percent = FORMAT([Percentage], "0.0%")
RETURN
CurrentCount & " (" & Percent & ")"
If that works for you, accept as a solution please.
Thank you!
Is it dynamic, will the branching work then? Also, I have 5 categories, not just product, will it work for others?
Also, I have created a measure that combines value and percentage and I can't put it in "Analyze" because now it is a "text" and not a number.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.