Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Powerbi_user26
Frequent Visitor

Lookup based on text.contains from one table to another in Power query

Hi,
I am trying add a custom column by doing a  lookup from my Keywords_Con table to Index_Con table in Power Query.
keywords_Con table is having multiple words separated by "," which I am trying to do a lookup using text.contains.
Requirement : If first word from keywords_Con matches the Index_Con Keyword column then return the Index number.

Keywords_Con :

Keywords
Citrix,Frozen,Session,Citrix 
devops,Bot
RPA ,Bot


Index_Con:

KeywordsIndex
Citrix1
Devops2
Bot3
RPA4


Code 

 

if (Text.Contains([Keywords], Index_con[keywords]))
then Index_con[Index] 
else null

 

 
Expected results in Keyword_Con table

keywordsIndex
Citrix,Frozen,Session,Citrix 1
devops,Bot2
RPA ,Bot4


Thanks in Advance 

1 ACCEPTED SOLUTION
MNedix
Solution Supplier
Solution Supplier

Hi,

I did the following:
1. I've split the Keyword_COn table in Power QUery by Comma delimiter

2. In the Keyword_Con table I've created the below column

 

New_Index = LOOKUPVALUE(Index_Con[Index],Index_Con[Keywords],Keywords_Con[Keywords.1])

 

 

Lookup_2.jpg

 

If this solves your problem then please mark it as the solution.

View solution in original post

1 REPLY 1
MNedix
Solution Supplier
Solution Supplier

Hi,

I did the following:
1. I've split the Keyword_COn table in Power QUery by Comma delimiter

2. In the Keyword_Con table I've created the below column

 

New_Index = LOOKUPVALUE(Index_Con[Index],Index_Con[Keywords],Keywords_Con[Keywords.1])

 

 

Lookup_2.jpg

 

If this solves your problem then please mark it as the solution.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.