Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello All,
I have a report where I have slicer values like US-Canada,APAC and Overall.
And I have department values like Central,Georgia,Hyd and Pune
My requirement is If I select slicer as US-Canada then I need to show only Central,Georgia
If I select slicer as APAC then I need to show only Hyd,Pune
If I select slicer as Overall then I need to show All 4.i.e, Central,Georgia,Hyd,Pune
So I created below dax and put it in filters for department slicer.
I am getting my resuly, But the issue here is its saving the last selected value and showing in other filter also.
lag =
SWITCH (
SELECTEDVALUE ( 'For Slicer'[Value] ),
"APAC",
IF (
MAX ( 'Table'[Department] ) = "Hyd"
|| MAX ( 'Table'[Department] ) = "Pune",
1,
0
),
"US-Canada",
IF (
MAX ( 'Table'[Department] ) = "Central"
|| MAX ( 'Table'[Department] ) = "Georgia",
1,
0
),
1
)Lets say If I select region slicer as us-canada and its showing central and Geogia
So Now If I select department as Geogia and then change the region slicer as APAC Its showing Geogia again in that.
Solved: Re: How to write if else in power Bi Dax - Microsoft Power BI Community
is what I did
Solved! Go to Solution.
Hi @Anonymous ,
I have created a sample to have a test. I think your code is correct. Your issue should be caused that you have selected "Georgia" before. Power BI won't remove the selection though "Georgia" should be hidden based on filter. Here I suggest you to clear selections in "Department" slicer. And then "Georgia" will disappear.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
I have created a sample to have a test. I think your code is correct. Your issue should be caused that you have selected "Georgia" before. Power BI won't remove the selection though "Georgia" should be hidden based on filter. Here I suggest you to clear selections in "Department" slicer. And then "Georgia" will disappear.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.