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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
petrcz
Regular Visitor

POWER QUERY - Check if a row contains substring from another table

Hi,

 

I wonder, if there is a way, how to look up for values between tables.

For example, there is a table containing (besides other columns) this column

 

String (head)
Holiday in Mexico
Cuba cruise
Best ski resort Canada
Honeymoon Italy
cheap holiday

  

Then, there is another table which contains a list of countries (see below).

Is there a way how to add a column in a table "String" whereas the value in this new column will contain the name of a country if the string contains a country. Otherwise, there will be "null" or just blank()

 

Country (head)
Mexico
Cuba
Canada
Italy

 

So the ourput for this case would be:

 

String (head)Country (head)
Holiday in MexicoHoliday
Cuba cruiseCuba
Best ski resort CanadaCanada
Honeymoon ItalyItaly
cheap holiday 

 

Then, is there a way, how to handle this? (see below)

Check, if there is a value from Countries[Substring] in String[String], if yes, add to String[String] the value from Countries[Country].

In the tables below, in the added column, there will be a value "Canada" and "Italy" becaluse "Canadian ski resorts" contains a substring "Canad"

 

String (head)
Canadian ski resorts
Italian cuisine

 

SubstringCountry
CanadCanada
ItalItaly

 

Thank you in advance for suggestions..

 

Petr

1 REPLY 1
v-huizhn-msft
Employee
Employee

Hi @petrcz,

Please refer to the similar thread. If you have any other issue, please feel free to ask.

Best Regards,
Angelia

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors