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! Learn more

Reply
Dexter1088
Frequent Visitor

Best way to get multi select slicer to work with IF Statement

Hi All, 

Running into a what I think should be a simple solution, but having issues.

I have a cusom table for category options that I use for my slicer.
When you select the category, I have a measure that uses a IF statement to pull the LAT and LONG for the locations that fall under that category for my map. 
This works perfectly if I enable single select, but I need it to work with multi select as well.

I tried something like this to see what all is selected, but can't seem to figure out how to translate it to a IF statement without writing all 511 possibilities of selections lol.

a_SelectedCAT = 
IF(
    ISFILTERED(Cat_Picker[Column1]),
    CONCATENATEX(DISTINCT(Cat_Picker[Column1]),Cat_Picker[Column1],"|"),"")


Any ideas or help definantly appreciated, thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Dexter1088

 Thank you very much for your reply. I created a table with your data:

vjianpengmsft_0-1729232662696.png

First, reference this table:

vjianpengmsft_1-1729232700622.png

vjianpengmsft_2-1729232730768.png

vjianpengmsft_3-1729232788149.png

vjianpengmsft_4-1729232806062.png

vjianpengmsft_5-1729232858742.png

vjianpengmsft_6-1729232892110.png

vjianpengmsft_7-1729232921172.png

vjianpengmsft_8-1729232947503.png

vjianpengmsft_9-1729232976776.png

vjianpengmsft_10-1729233006848.png

 

The results are as follows:

vjianpengmsft_11-1729233045330.png

vjianpengmsft_12-1729233056392.png

I have included the PBIX file used for this tutorial below.

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

3 REPLIES 3
Anonymous
Not applicable

Hi, @Dexter1088 

Based on your description, I've created the following sample data:

vjianpengmsft_0-1729131516992.png

vjianpengmsft_1-1729131531034.png

I created a measure:

FilteredLATLONG = 
IF(
    ISFILTERED(Cat_Picker[Column1]),
    CALCULATE(
        CONCATENATEX(
            'LocationTable',
            'LocationTable'[LAT] & "," & 'LocationTable'[LONG],
            ";"
        ),
        'LocationTable'[Category] IN VALUES(Cat_Picker[Column1])
    ),
    BLANK()
)
a_SelectedCAT = 
IF(
    ISFILTERED(Cat_Picker[Column1]),
    CONCATENATEX(DISTINCT(Cat_Picker[Column1]), Cat_Picker[Column1], "|"),
    ""
)

Here are the results:

vjianpengmsft_2-1729131703164.png

vjianpengmsft_3-1729131896509.png

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Very well written thank you! trying to make this work with my current set up is posing issues though, let me explain more, to see if there is an easier way, thanks!

Here are my table setups going off your example, My Location table is unique to the location and the categories are built out in columns. 

Dexter1088_0-1729175869121.png

My Category picker table is the same as yours

Dexter1088_1-1729175909618.png


And I forgot to mention I have a seoerate measures for LAT and LONG so I can put them in the Azure map like so.

Dexter1088_2-1729176050046.png


I can get this to work if you select only 1 category at a time, I just cant get it to plot on a map if you select more than 1 category. Like sometimes we want to see locations that have Food and Health only on the map, thanks!




Anonymous
Not applicable

Hi, @Dexter1088

 Thank you very much for your reply. I created a table with your data:

vjianpengmsft_0-1729232662696.png

First, reference this table:

vjianpengmsft_1-1729232700622.png

vjianpengmsft_2-1729232730768.png

vjianpengmsft_3-1729232788149.png

vjianpengmsft_4-1729232806062.png

vjianpengmsft_5-1729232858742.png

vjianpengmsft_6-1729232892110.png

vjianpengmsft_7-1729232921172.png

vjianpengmsft_8-1729232947503.png

vjianpengmsft_9-1729232976776.png

vjianpengmsft_10-1729233006848.png

 

The results are as follows:

vjianpengmsft_11-1729233045330.png

vjianpengmsft_12-1729233056392.png

I have included the PBIX file used for this tutorial below.

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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