Forum Discussion
Anonymous
4 years agoNot applicable
Search text for substring as a whole word
Hi everyone,
I'd like to create a new column with values "true" or "false" based on whether or not another column contains a keyword I am searching for. But I'd like "true" to be the case only when the keyword appears as a full word and not when it is only part of a word.
For example, if the keyword to search for is "IT":
"HEAD OF IT" and "IT WORKER" should both be "true", but "CITY WORKER" should be "false".
Can this be done using either Power Query or DAX?
- Anonymous4 years ago
Hi Anonymous
Split the text and use List.Contains
List.Contains(Text.Split([Column1]," "),"IT")
2 Replies
- AnonymousNot applicable
Hi Anonymous
Split the text and use List.Contains
List.Contains(Text.Split([Column1]," "),"IT")- AnonymousNot applicable
Anonymous Thank you very much!