Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
AntonioPetak
Regular Visitor

Power BI - Decomposition tree values and percentages

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.

AntonioPetak_0-1738931517148.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @AntonioPetak 

 

Please try this:

Here I create a set of sample:

vzhengdxumsft_0-1739174845732.png

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:

vzhengdxumsft_1-1739175006667.pngvzhengdxumsft_2-1739175013101.png

 

 

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.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @AntonioPetak 

 

Please try this:

Here I create a set of sample:

vzhengdxumsft_0-1739174845732.png

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:

vzhengdxumsft_1-1739175006667.pngvzhengdxumsft_2-1739175013101.png

 

 

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.

rohit1991
Super User
Super User

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.

1. Create a Measure for Absolute Values: Total_Products = SUM('Table'[Product_Count])

2. Create a Percentage Measure

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)

3. Combine Value and Percentage into a Single Measure

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%") & ")"

4. Add the Measure to the Decomposition Tree

  1. Insert a Decomposition Tree visual in Power BI.
  2. Drag the Value_Percentage measure into the Analyze field.
  3. Add Country, Manufacturer, and Product Mark to the Explain by field.
  4. The values will now appear as "Value (Percentage)" in the breakdown.

 

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

The "Analyze" field requires a number, I can't put a string value inside.

anilelmastasi
Super User
Super User

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.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors