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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Marcelo_Koboldt
Frequent Visitor

Filter single value in slicer from multiple values inside string

Hi guys,

 

I am having a hard time in trying to figure out how to filter a value inside a string based on a single value slicer selection with DAX. I know I can get my job done in M with pivoting some data but I also think that it is possible to do this with DAX. 

 

For example, let me post an image to best show my issue:

Marcelo_Koboldt_0-1666886557712.png 

Marcelo_Koboldt_1-1666886603101.png

 

So, basically what I want is to select 'cleaning' in the slicer and it will select the rows with 'cleaning' on it. 

(just for curiosity, I am using it in a map visual so that if I select cleaning it will only shows services which have 'cleaning' on it)

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Marcelo_Koboldt ,

 

Try like below:

Find =
VAR sel =
    SELECTEDVALUE ( Slicer[Slicer] )
VAR find_ =
    SEARCH ( sel, MAX ( 'Table'[Data] ),, -1 )
RETURN
    IF ( find_ <> -1, 1, 0 )

vhenrykmstf_0-1666945960172.png

vhenrykmstf_1-1666945981291.pngvhenrykmstf_2-1666945994342.png

 

If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.


Best Regards,
Henry


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

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @Marcelo_Koboldt ,

 

Try like below:

Find =
VAR sel =
    SELECTEDVALUE ( Slicer[Slicer] )
VAR find_ =
    SEARCH ( sel, MAX ( 'Table'[Data] ),, -1 )
RETURN
    IF ( find_ <> -1, 1, 0 )

vhenrykmstf_0-1666945960172.png

vhenrykmstf_1-1666945981291.pngvhenrykmstf_2-1666945994342.png

 

If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.


Best Regards,
Henry


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

 

 

Thank you so much! 

 

It is working perfectly fine. Just for curiosity, why did you use MAX () inside of SEARCH?

I'm still learning and mastering the use of Variables inside DAX and trying to get used to everything in it.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.