Forum Discussion

saurabh_kedia_'s avatar
saurabh_kedia_
Microsoft Employee
7 years ago
Solved

Dynamic measure calculation for hierarchy data

Hi Folks,   I'm trying to calculate one measure which can display different values depending on the level of drill down.       Below is the hierarchy: Level1 Name Level2 Name A C B D B E B F B...
  • v-jiascu-msft's avatar
    7 years ago

    Hi Saurabh,

     

    Please download the demo from the attachment then you can check the details.

    1. Establish proper relationships.

    2. Create three measures.

    Not_Started Sum =
    IF (
        ISFILTERED ( Table1[Level2 Name] ),
        SUM ( Table3[Not_Started] ),
        SUM ( Table2[Not_Started] )
    )
    
    Inprogress Sum =
    IF (
        ISFILTERED ( Table1[Level2 Name] ),
        SUM ( Table3[Inprogress] ),
        SUM ( Table2[Inprogress] )
    )
    
    Completed Sum =
    IF (
        ISFILTERED ( Table1[Level2 Name] ),
        SUM ( Table3[Completed] ),
        SUM ( Table2[Completed] )
    )
    

    Dynamic-measure-calculation-for-hierarchy-data

     

    Best Regards,
    Dale

  • v-jiascu-msft's avatar
    v-jiascu-msft
    7 years ago

    Hi Saurabh,

     

    Did it have the similar structure for the third level like below?

    Level1 Name    Level2 Name     Level3 Name

     

    If so, please try this formula. If not, please provide a sample. The main idea is recognizing the lower level first.

     

    Completed Sum =
    IF (
        ISFILTERED ( Table2_1[Level1 Name] ),
        SUM ( Table2_1[Completed] ),
        IF (
            ISFILTERED ( Table1[Level2 Name] ),
            SUM ( Table3[Completed] ),
            SUM ( Table2[Completed] )
        )
    )
    

     

    Best Regards,
    Dale