Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

slicer saving last selected value

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.

 

 

Sathvik123_0-1662016170729.png

 

Solved: Re: How to write if else in power Bi Dax - Microsoft Power BI Community 

is what I did 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

RicoZhou_0-1662101169838.png

 

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.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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.

RicoZhou_0-1662101169838.png

 

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.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors