Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Decomposition tree percentages based on first value

Hi all,   I'm struggling getting the decomposition tree to do what I want.  I'm currently looking at this example:   You see here that the percentages in plaza are based on the total, w...
  • v-kelly-msft's avatar
    v-kelly-msft
    6 years ago

    Hi Anonymous ,

     

    I find a solution for you:

    Instead of creating calculated columns,you can create a measure:

     

    Measure 2 = 
    IF (
     HASONEFILTER ( 'Table'[category] ),
     COUNT ( 'Table'[measure] )
     / CALCULATE ( COUNT ( 'Table'[measure] ), ALLEXCEPT ( 'Table', 'Table'[Plaza] ) ),
     COUNT ( 'Table'[measure] )
     / CALCULATE ( COUNT ( 'Table'[measure] ), ALL ( 'Table' ) )
    )

     

    Put measure 2 in the "Analyze" filed, and "plaza" and "category" in the "explain by":

     

    Remember to set measure 2 as percentage:

     

    Finally you will see:

     

     

    For the related .pbix file,pls click here.

     

     


    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!