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

M Power Query Lookup words from table

Hello,

 

I try to do the following in Power Query:

 

I have a dataset which contains a text column and an other table (lookup table) with a list of words (around 200). If the text from my dataset contains one or more words from the lookup table i want to add those words in a new column (comma seperated)

 

Below an example of how I would like to have it.

 

I hope someone can help me with this, thanks in advance!!

 

Regards, Tiemen

example.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: M Power Query Lookup words from table

@Tiemen 

 

Please see attached file as well

 

Tieman.png

3 REPLIES 3
Super User
Super User

Re: M Power Query Lookup words from table

Hi @Tiemen 

 

See if this helps

 

First add a custom column

 

=Text.SplitAny([Text]," ?")

and then

Text.Combine(
List.Select([Custom], each List.Contains(Lookup[Words],_,Comparer.OrdinalIgnoreCase))
,
",")
Super User
Super User

Re: M Power Query Lookup words from table

@Tiemen 

 

Please see attached file as well

 

Tieman.png

Tiemen Regular Visitor
Regular Visitor

Re: M Power Query Lookup words from table

@Zubair_Muhammad  Thank you very much!! This works perfectly Smiley Very Happy