Forum Discussion

FetchCB's avatar
FetchCB
Regular Visitor
8 years ago
Solved

Hirearchy Slicer - Getting Value Selected

I Have  Sales Hireachy Consisting of Depot,Region,Division and Company all siting in a Hirearchal Slicer.   What Id like to do is to have a card that shows the value that was selected whether it wa...
  • FetchCB's avatar
    FetchCB
    8 years ago

    Hi  Think I have got this sorted now 

     

    My example data:

     

    Depot Hirearchy

    Transactions

     

     

    The issue I was having that I couldnt get a card to dynamically show the value id selected in the hirearchy ie if I picked the South Division I wanted the Card to show South.

     

    This was my solution:

     

    Create a measure ( I called it Depot Selection) in the Depot Hirearchy and use the following formula

     

    DepotSelected = " Transactions For " & IF(ISFILTERED('Depot Hirearchy'[Depot]),SELECTEDVALUE('Depot Hirearchy'[Depot]),IF(ISFILTERED('Depot Hirearchy'[Region]),SELECTEDVALUE('Depot Hirearchy'[Region]),IF(ISFILTERED('Depot Hirearchy'[Division]),SELECTEDVALUE('Depot Hirearchy'[Division]),IF(ISFILTERED('Depot Hirearchy'[Comapny]),SELECTEDVALUE('Depot Hirearchy'[Company]))))) 

     

    This is in reverse order to the Hirearchy as what I discovered was that all the levels above the level you choose are also "Filtered" so by using the IF statement in reverse order I can find out which level is the first Filtered level which logically must be the level chosen.

     

    This is what the sample report looks like

     

     

    Many thanks for replying and offering to help