Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
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:
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)
Solved! Go to Solution.
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 )
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.
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 )
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.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 61 | |
| 49 | |
| 30 | |
| 25 | |
| 23 |
| User | Count |
|---|---|
| 128 | |
| 102 | |
| 57 | |
| 39 | |
| 31 |