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 to filter with in operator

Hello,

 

I'm trying to solve a problem:

 

I have two tables, CSMs and Issues. The CSMs table has one column, CSM and it's text column which is a list of about 20 names.

 

The Issues table has a text column called CSM that contains the same names as the CSMs table, but sometimes there are multiple names in that column separated by commas.

 

I want to add a slicer to a page with its Field being 'CSMs'[CSM] but when a name is selected in the slicer, the Issues table is filtered not just by rows with that exact match in the CSM column but any row where the selected name exists in the CSM column.

I can't see that you can apply the in operator to a relationship between two tables, and if I split the 'Issues'[CSM] into rows on the comma it'll stuff up all my measures. 

How can I solve this, I'm happy using Power Query or DAX.

 

Many thanks in advance.

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@Anonymous 

I was able to get it to work for a single selection using the CONTAINSSTRING.

Measure = 
VAR _Name = SELECTEDVALUE(names[Name])
RETURN IF(CONTAINSSTRING(SELECTEDVALUE(Issues[Name]),_Name),1)

Putting that measure as a fitler on the issues table set to Is Not Blank will filter to only the rows where the names list containst the selected name.

2020-06-25_18-55-09.png

I have attached my sample file for you to look at.

2020-06-25_18-56-40.png

I can't think of a way to do it where you could select more than one name.  For that I though you would have to split the names on the issues so it could be joined to the employee table.

View solution in original post

3 REPLIES 3
jdbuchanan71
Super User
Super User

@Anonymous 

I was able to get it to work for a single selection using the CONTAINSSTRING.

Measure = 
VAR _Name = SELECTEDVALUE(names[Name])
RETURN IF(CONTAINSSTRING(SELECTEDVALUE(Issues[Name]),_Name),1)

Putting that measure as a fitler on the issues table set to Is Not Blank will filter to only the rows where the names list containst the selected name.

2020-06-25_18-55-09.png

I have attached my sample file for you to look at.

2020-06-25_18-56-40.png

I can't think of a way to do it where you could select more than one name.  For that I though you would have to split the names on the issues so it could be joined to the employee table.

Anonymous
Not applicable

Thanks @jdbuchanan71  this achieves what I need.

amitchandak
Super User
Super User

@Anonymous , Better would be that you split into rows and handle duplication because of that in the calculation .

create an index column and then split.

The other way would be the get these names into a separate table and then split it there.

and the use containsstring , find and search in the formula when every you select some value in the slicer. No need to join this new table with split names with the main table back

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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