Forum Discussion
How do I find exact text within a string?
- 5 years ago
Anonymous , Try CONTAINSSTRINGEXACT
CONTAINSSTRINGEXACT('ssc_db_001 ga_report'[Comment], "TU")
https://docs.microsoft.com/en-us/dax/containsstringexact-function-dax
Anonymous , Try CONTAINSSTRINGEXACT
CONTAINSSTRINGEXACT('ssc_db_001 ga_report'[Comment], "TU")
https://docs.microsoft.com/en-us/dax/containsstringexact-function-dax
- Anonymous5 years agoNot applicable
amitchandak Thank you for this... However if I could be cheeky and add another layer, often I will be looking for multiple keywords within a large data set, grouped together ie count incidents with "TU" & "BU" within the comments . however, if both key words are within the same text, I believe it counts 2 instead of 1? Is it possible to amend this?
Thank you again for your help.
- Anonymous5 years agoNot applicable
Hi Anonymous ,
Try this
Column = CONTAINSSTRINGEXACT([Column1],"TU")|| CONTAINSSTRINGEXACT([Column1],"BU")CONTAINSSTRINGEXACT returns True/False. How do you want to count?
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous5 years agoNot applicable
Hi Anonymous,
Sorry for my delayed response, I have not had access to the site.
Ideally I would like to count each incident where "TU" or "BU" appears in a comment/ text string, but only count once if one of them appears within a sentence. The Original formula and the one accepted as a solution- Counts 2 if TU & BU appear in the same text string as opposed to 1.
I hope I have coveyed my message well!
Kind regards,
Alex