Forum Discussion
Hirearchy Slicer - Getting Value Selected
- 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
Can you post some sample data so that I can try this out? I am thinking that if you do something like a SUMMARIZE of your table or perhaps a CALCULATETABLE or just the current table that you could grab the MAXX of whatever column value you are looking for since your current table should only have the values currently selected in the hierarchy slicer.
- FetchCB8 years agoRegular Visitor
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