Forum Discussion
atavo
7 years agoHelper I
SEARCH TEXT STRING BASED ON LIST OF VALUES - EXACT MATCH
Hi
There have been solutions offered regarding searching string text using a list of values, eg:
2. https://community.powerbi.com/t5/Desktop/joinAlgorithm-and-keyEqualityComparers/m-p/182148#M79842
...but these do not address the following challenge
PROBLEM
Text: "I LOVE MOTORBIKES".
List of Values: BIKES, BIKE, MOTOR, MOTORBIKE, MOTORBIKES
CHALLENGE: When I perform the comparison, ONLY "MOTORBIKES" should return TRUE.
Is there a way of doing this in Power Query
Thanks in advance
Alfred
- Thanks
Was able to solve the problem by wrapping the string text in single spaces (b4 and after). Did the same with the list of lookup values. Thereafter, comparison worked like a gem.
Alfred
4 Replies
- StachuCommunity Champion
you convert the text to list and then use list comparators, e.g. List.Contains
https://docs.microsoft.com/en-us/powerquery-m/list-contains - atavoHelper IThanks
Was able to solve the problem by wrapping the string text in single spaces (b4 and after). Did the same with the list of lookup values. Thereafter, comparison worked like a gem.
Alfred - AnonymousNot applicable
Can you please show me how to do this? I am stuck. Thank you.
- AnonymousNot applicable