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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
carlosbarbosa
New Member

Percentage of the parent node in Decomposition tree

Good Afternoon everyone. 

I have spent a few hours try to make it works, but I could. Maybe one of you could light up my thoughts.

I have a summary table that has values UNIQUEID, Graduated (Yes/NO), Field (STEM, Health Sciences, Business, etc), Transferred (Yes/No) and Transferred Field(STEM, Health Sciences and etc).

The table has the correct format and I am getting the values I am looking for.

I created this decomposition tree.

carlosbarbosa_0-1725386639858.png

 

 

Percentage of Parent Level = 
DIVIDE(
    COUNT(SummaryTable[ID]),
    CALCULATE(
        COUNT(SummaryTable[ID]),
        ALLSELECTED(SummaryTable)
    )
)

 

 

 

That is the dax measure that I am using to calculate the percentage and I am adding that as tooltip.

The value is correct for the first branch since it consider the total cohort. 
The issue starts when I got to the second branch. The Percentagen of the Yes I would like to be considerer from the Total of STEM and no longer from Total Cohort.

In my current setup the tooltip for yes show me: 23.67%. That is correct if we divide 392 by 1656. But I would like to be 42.66%, dividing the 392 by 919.

Here is the code that I used to create the summary table:

 

 

SummaryTable = 
SUMMARIZE(
    X_cohort, 
    X_cohort[ID], 
    "Graduated", MAX(X_cohort[Graduated]),
    "Academic_field", MAX(X_cohort[Academic_field]),
    "Transferred", MAX(X_cohort[Transferred]),
    "Transferred_Field", MAX(X_cohort[Transferred Field])
)

 

 


Please, if anybody have a different approach, please, let me know. I would appreciate it

6 REPLIES 6
suparnababu8
Super User
Super User

Hi @carlosbarbosa 

To calculate the percentage of the parent level correctly in a decomposition tree, you need to adjust your DAX measure to consider the context of the parent node. This means that when you drill down to the second branch, the percentage should be calculated based on the total of the parent node rather than the total cohort.

Here’s how you can adjust your DAX measure:

Adjusted DAX Measure

  1. Create a Measure for the Parent Level

 

ParentLevelCount = 
CALCULATE(
    COUNT(SummaryTable[ID]),
    ALLSELECTED(SummaryTable),
    REMOVEFILTERS(SummaryTable[Graduated])
)

 

  • Create the Percentage of Parent Level Measure 

 

PercentageOfParentLevel = 
DIVIDE(
    COUNT(SummaryTable[ID]),
    [ParentLevelCount]
)

 

Applying the Measure

  1. Add the Measure to Your Decomposition Tree:

    • Use the PercentageOfParentLevel measure in your decomposition tree visual.
  2. Set Up the Tooltip:

    • Add the PercentageOfParentLevel measure as a tooltip in your decomposition tree visual.

This setup will ensure that the percentage is calculated correctly based on the parent node, providing the desired result when you drill down into the branches.

Thank you for replying, but the output with the adjusted DAX got me the same what I was getting before 😞

Anonymous
Not applicable

Hi @carlosbarbosa ,

I create a table as an example.

vyilongmsft_0-1725603078955.png

Actually when you add Decomposition tree visual.

vyilongmsft_1-1725603140962.png

Once you add the content you need in the appropriate places, the percentages are actually realized based on what you want.

vyilongmsft_2-1725603180369.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you for replying. I see that you were using the an alternative visual.
I added that one and it worked that way I intended until the second level, but that visual didn't let me adding more.

I add an extra column in your table and adjusted your visual and didn't work either. Thank you tho.

lbendlin
Super User
Super User

Not exactly what you are looking for but a potential alternative.

 

lbendlin_0-1725407237021.png

 

I have tried that but that takes the percentage of the Total (top parent). In my sitatuon I would like to know how is the percetagem of the students who graduated transferred to another institution.

Thanks for replying tho

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors