Merge two tables in power query editor (Power BI) based on string similarity with Python
Consider the tables bellow:
Table1 Table1 | Name | ... | | ------ | --- | | Apple Fruit A11 | ... | | Banana Fruit B12 | ... | | ... | ... |
Table2 Table2 | Name | Value | | ------ | ----- | | Apple A11R/T | 40 | | B4n4n4 Fruit B12_T | 50 | | Berry A11 | 60 | | ... | ... |
I want to get the Value from Table2 into Table1. But for some reason when I use the built-in power query editor merge with fuzzy matching. It will match Apple Fruit A11 with Berry A11 instead of Apple A11 R/T. I've read the documentation, and it says that the built-in function works best with single words. I tried to remove spaces both from Table1[Name] and Table2[Name] but it didn't improve results.
I looked around trying to find a solution, but wasn't able to figure out yet. Is there a way to do this using python? Or is there a simpler solution?
The results that I am expecting:
Table1 Expected Result | Name | ... | Table2.Name | Table2.Value | | ------ | --- |---| --- | | Apple Fruit A11 | ... |Apple A11R/T |40 | | Banana Fruit B12 | ... |B4n4n4 Fruit B12_T |50 | | ... | ... |... |... |
--- For some reason the tables are not showing up like the preview, that's why there are also images for each table.
source https://stackoverflow.com/questions/76384972/is-it-possible-to-merge-two-tables-in-power-query-editor-power-bi-with-python
Comments
Post a Comment