Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi everyone,
I am new to power bi and DAX, I have a hierarch slicer and a card to display what I have selected in the slicer how do I do this in DAX?
here is a screenshot of what I want to achieve
once I select on new zealand it should display new zealand, when I select 2079 it should only display 2079, when I select an employee is should display only the employee for example 1006098 - Simon Wall
Thanks in advance for your responses
Solved! Go to Solution.
May be.. something like this.
Checking if the lowest level is filtered>>then next upper level>>then next
See the attached sample file as well
Measure = SWITCH ( TRUE (), ISFILTERED ( Table1[Level3] ), CONCATENATEX ( VALUES ( Table1[Level3] ), [Level3], "," ), ISFILTERED ( Table1[Level2] ), CONCATENATEX ( VALUES ( Table1[Level2] ), [Level2], "," ), ISFILTERED ( Table1[Level1] ), CONCATENATEX ( VALUES ( Table1[Level1] ), [Level1], "," ) )
I see that order of levels 2 and 3 in your MEASURE was not correct.
Use this MEASURE
Selectedslicer = SWITCH ( TRUE (), ISFILTERED ( FACT_UTE[Employee] ), SELECTEDVALUE ( FACT_UTE[Employee] ), ISFILTERED ( FACT_UTE[SG_Code] ), SELECTEDVALUE ( FACT_UTE[SG_Code] ), ISFILTERED ( FACT_UTE[OC] ), SELECTEDVALUE ( FACT_UTE[OC] ), ISFILTERED ( FACT_UTE[Region] ), SELECTEDVALUE ( FACT_UTE[Region] ), "Select a value" )
May be.. something like this.
Checking if the lowest level is filtered>>then next upper level>>then next
See the attached sample file as well
Measure = SWITCH ( TRUE (), ISFILTERED ( Table1[Level3] ), CONCATENATEX ( VALUES ( Table1[Level3] ), [Level3], "," ), ISFILTERED ( Table1[Level2] ), CONCATENATEX ( VALUES ( Table1[Level2] ), [Level2], "," ), ISFILTERED ( Table1[Level1] ), CONCATENATEX ( VALUES ( Table1[Level1] ), [Level1], "," ) )
Hi @Zubair_Muhammad ,
I tried your formula and tweaked it, I came up with a problem.
it works when I select region, and the following hierarchy but when I select 20014 it doesn't appear, but when I select employee it does appear
Could you share your file?
Did you include all four levels in the formula?
Yes I included all the levels
I will share you the file now, I can't share files right now because I am still new but here is the access to the google drive I saved it in
https://drive.google.com/file/d/1WzIcG_ouKfWHKp3s6eotE99-GKgvrofm/view?usp=sharing
I see that order of levels 2 and 3 in your MEASURE was not correct.
Use this MEASURE
Selectedslicer = SWITCH ( TRUE (), ISFILTERED ( FACT_UTE[Employee] ), SELECTEDVALUE ( FACT_UTE[Employee] ), ISFILTERED ( FACT_UTE[SG_Code] ), SELECTEDVALUE ( FACT_UTE[SG_Code] ), ISFILTERED ( FACT_UTE[OC] ), SELECTEDVALUE ( FACT_UTE[OC] ), ISFILTERED ( FACT_UTE[Region] ), SELECTEDVALUE ( FACT_UTE[Region] ), "Select a value" )
Wow! Thank you so much @Zubair_Muhammad you're a life saver, it worked great I failed to see my mistake thank you!
I am looking for help with similar case, I need to create a measure which will return selected value from hierarchy slicer but only when there is only one selected.
When there is more than one value selected it should return BLANK.
In this example it should return BLANK :
In this selection it shoudl return 20 :
In this example it should return 110:
I wil be grateful for help.
Thank you for the reply,
It worked perfectly thank you!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
85 | |
83 | |
66 | |
60 | |
58 |
User | Count |
---|---|
194 | |
111 | |
105 | |
79 | |
71 |