Forum Discussion
Searching for a partial match in a string based on values in a another table
- 6 years ago
Hi Anonymous ,
Please check if the result below meets your requirements.
Steps:
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 Anonymous ,
I would prefer M.
Try a fuzzy matching
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.
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:
| City | State | StateAbv |
| augusta | georgia | ga |
| detroit | michigan | mi |
| columbus | georgia | ga |
| columbus | ohio | oh |
| evansville | indiana | in |
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
| Words | City | StateAbv |
| This is an example string for ohio by cleveland | cleveland | oh |
| an example in detroit | detroit | |
| augusta ga value here | augusta | ga |
| example for cleveland | cleveland | |
| evansville in value | evansville | in |
Would fuzzy matching be able to pick up on these nuances?