Forum Discussion

TaroGulati's avatar
TaroGulati
Helper III
1 year ago
Solved

Hierarchy level sum

Hi all, 

 

I am trying to do the sum from fact tables based on the different hierarchy level selected from the dimension. In the below screen on the left I have a dimension table and on the right there is fact table: 

 

When in a matrix visual if category from dimension is in scope i want to show the sum of amount category from fact table, if sub category is inscope then sum of amount sub category. I tried it using isinscope function but not working. 

 

In the attachment, PBIX file. 

 

Thanks

 

https://onedrive.live.com/?id=93E25D0F6AEA0183%21sb6c219f638834e3cb461a148dd6e3c69&cid=93E25D0F6AEA0183&sb=name&sd=1 

 

 

https://1drv.ms/u/c/93e25d0f6aea0183/ERs4PnNxej1LrrXanT3xsD8BuV23PmgGGCd5FODpZForTw?e=9gqOd4 

  • Hi TaroGulati 

    You need to use ISINSCOPE on the bottom layer not the top layer.

    Amount =

    IF(
        ISINSCOPE('Dimension'[Sub-category] )
        ,sum('Fact'[Amount Sub category])
        ,sum('Fact'[Amount Category])
        )
     

     

1 Reply

  • Hi TaroGulati 

    You need to use ISINSCOPE on the bottom layer not the top layer.

    Amount =

    IF(
        ISINSCOPE('Dimension'[Sub-category] )
        ,sum('Fact'[Amount Sub category])
        ,sum('Fact'[Amount Category])
        )