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
tkcsp
New Member

Searching for a partial match in a string based on values in a another table

I'm trying to create a new column based on partial text matches in my first column when compared to my reference table.

 

My Locations reference table is set up like:

Locations

CityStateStateAbv
augustageorgiaga
detroitmichiganmi
clevelandohiooh

 

The strings would be:

 

Table1

Words
This is and example string cleveland
A Detroit Example
augusta value here

 

The end result would be:

Table1

 

WordsLocation
This is and example string clevelandCleveland
A Detroit ExampleDetroit
augusta value hereAugusta

 

What would be the best way to achieve this in DAX or M?

 

Thanks!

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @tkcsp ,

 

Please check if the result below meets your requirements.

words.PNG

Steps:

split.gif

 

For details, please check the attached PBIX file.

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Icey
Community Support
Community Support

Hi @tkcsp ,

 

Please check if the result below meets your requirements.

words.PNG

Steps:

split.gif

 

For details, please check the attached PBIX file.

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @tkcsp ,

 

I would prefer M.

Try a fuzzy matching

20200114_Fuzzy.png

 

Regards,

Marcus

Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


This solution works for my original question, but I was hoping I'd be able to take the answer and extrapolate on it and I think fuzzy matching presents issues with state abreviations. In the data there will occasionally be references to state names and abreviations and some states share city names (e.g. Columbus, GA and Columbus, OH). Also, I could see an issue with the state Indiana being abreviated as "in" where the phrase "in" will also be used as a preposition.

 

Updated Locations Table:

CityStateStateAbv
augustageorgiaga
detroitmichiganmi
columbusgeorgiaga
columbusohiooh
evansvilleindianain

 

Table1

Words
This is an example string for ohio by cleveland
an example in detroit
augusta ga value here
example for cleveland
evansville in value

 

Expected end result:

 

Table1

WordsCityStateAbv
This is an example string for ohio by clevelandclevelandoh
an example in detroitdetroit 
augusta ga value hereaugustaga
example for clevelandcleveland 
evansville in valueevansvillein

 

Would fuzzy matching be able to pick up on these nuances?

 

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.