cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
atavo Regular Visitor
Regular Visitor

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:

 

1. https://community.powerbi.com/t5/Desktop/Power-query-Add-column-with-list-of-keywords-found-in-text/...

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

1 ACCEPTED SOLUTION

Accepted Solutions
atavo Regular Visitor
Regular Visitor

Re: SEARCH TEXT STRING BASED ON LIST OF VALUES - EXACT MATCH

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

View solution in original post

2 REPLIES 2
Stachu Super Contributor
Super Contributor

Re: SEARCH TEXT STRING BASED ON LIST OF VALUES - EXACT MATCH

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

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

atavo Regular Visitor
Regular Visitor

Re: SEARCH TEXT STRING BASED ON LIST OF VALUES - EXACT MATCH

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

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Top Kudoed Authors
Users Online
Currently online: 62 members 1,070 guests
Please welcome our newest community members: