Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
84 | |
84 | |
65 | |
62 | |
55 |
User | Count |
---|---|
171 | |
109 | |
105 | |
73 | |
71 |