Forum Discussion
Anonymous
5 years agoNot applicable
Search text using multiple parameters
Hello - I wonder if anyone can spot the problem with my dax query? I am trying to search within a text using multiple parameters - The parameters are "Text search 1" ,"Text Search 2" and "T...
- 5 years ago
Hi, Anonymous
You may try the following measure to see if it helps.
Casenote mention count = VAR s1 = MAX ( 'Text Search'[Text Search] ) VAR s2 = MAX ( 'Text Search 2'[Text Search 2] ) VAR s3 = MAX ( 'Text Search 3'[Text Search 3] ) RETURN CALCULATE ( DISTINCTCOUNT ( 'All Casenotes'[CN Record ID] ), FILTER ( 'All Casenotes', CONTAINSSTRINGEXACT ( [Casenote text], s1 ) || CONTAINSSTRINGEXACT ( [Casenote text], s2 ) || CONTAINSSTRINGEXACT ( [Casenote text], s3 ) ) )Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-alq-msft
5 years agoCommunity Support
Hi, Anonymous
You may try the following measure to see if it helps.
Casenote mention count =
VAR s1 =
MAX ( 'Text Search'[Text Search] )
VAR s2 =
MAX ( 'Text Search 2'[Text Search 2] )
VAR s3 =
MAX ( 'Text Search 3'[Text Search 3] )
RETURN
CALCULATE (
DISTINCTCOUNT ( 'All Casenotes'[CN Record ID] ),
FILTER (
'All Casenotes',
CONTAINSSTRINGEXACT ( [Casenote text], s1 )
|| CONTAINSSTRINGEXACT ( [Casenote text], s2 )
|| CONTAINSSTRINGEXACT ( [Casenote text], s3 )
)
)
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.