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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Fuzzy option, or Table.FuzzyNestedJoin, not available

Dera All, 

 

In my version of MS Excel I done have the option to merge two tables using the build in Fuzzy library option, e.g. 'Table.FuzzyNestedJoin', they are not install unfortunetaly.  Is there a work-around using M lanague or is that very complicated?  I have done the same task in DAX, again in PowerBI and Excel's DataModel , but I woud like to test if this can alos be done in M Language.

 

See Snippet, I have removed any sensative data, as a reference to what I am meaning :

 

Fuzzy LookupFuzzy Lookup 

 

Any advise welcome.

 

Chris

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You could try adding a column that uses text functions on the current row value, and use them to compare to the other table's column values as as a list, and then wrap that in Table.FindText.  Of course the more parameters you use, the slower this would be:

 

Getlength = Table.AddColumn(PriorStepOrTableName, "len", each Text.Length([Client])-2, type number),
Custom3 = Table.AddColumn(Getlength, "front", each Text.Start([Client], [len]), type text),
Custom4 = Table.AddColumn(Custom3, "back", each Text.End([Client], [len]), type text),
Custom5 = Table.AddColumn(Custom4, "Fuzzy", each if List.Contains(Mail[Client], [Client]) then Table.FindText(Mail, [Client]) else if List.Contains(Mail[Client], [front]) then Table.FindText(Mail, [front]) else if List.Contains(Mail[Client], [back]) then Table.FindText(Mail, [back]) else null)
in
Custom5

 

Basically, you are adding a column for some (by no means comprehensive) text permutations.  Her is if the all but the first or last two characters match, we bring in a match from the other table.  I'm sure that @Imke or any of the other experts could do this without adding the columns first.  But just showing you that you can specify a lot of ways you' d like to match, and then use Table.FindText to bring in the matching rows instead of Table.Join.

 

Again, this is not very elegant, and it's pretty late, but like I said, any of the pros on here can probably improve upon this code once they get my point.  Hope any of this makes sense, but the kids are upstairs like it's noon, and it's 1:43 AM, better see ehat's going on up there!

 

--Nate

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi Nate

 

Many thanks, I will give this a try and let you know.  What I should I explained,  values are not in a uniform format.  For example  - 

 

 

Find This ValueAmongst this feild
AB123XX789, AC777 & ER777, AB123
ZZ111˽ZZ111
FG999FG999˽TH888

 

So in the sample  the frist column, I am able to clean and trim these values but I then need to find that value amonsgt the correprading column.  So I would be dealing commas, or and ampersand or odd characters along with the odd space added for a good measure.  

 

Disclaimer: Nate, I having an awlful feeling I may have asked the forum this question once before, I will have look back and check, but apology in the meantime if am wasting your time here.

Chris

Anonymous
Not applicable

You could try adding a column that uses text functions on the current row value, and use them to compare to the other table's column values as as a list, and then wrap that in Table.FindText.  Of course the more parameters you use, the slower this would be:

 

Getlength = Table.AddColumn(PriorStepOrTableName, "len", each Text.Length([Client])-2, type number),
Custom3 = Table.AddColumn(Getlength, "front", each Text.Start([Client], [len]), type text),
Custom4 = Table.AddColumn(Custom3, "back", each Text.End([Client], [len]), type text),
Custom5 = Table.AddColumn(Custom4, "Fuzzy", each if List.Contains(Mail[Client], [Client]) then Table.FindText(Mail, [Client]) else if List.Contains(Mail[Client], [front]) then Table.FindText(Mail, [front]) else if List.Contains(Mail[Client], [back]) then Table.FindText(Mail, [back]) else null)
in
Custom5

 

Basically, you are adding a column for some (by no means comprehensive) text permutations.  Her is if the all but the first or last two characters match, we bring in a match from the other table.  I'm sure that @Imke or any of the other experts could do this without adding the columns first.  But just showing you that you can specify a lot of ways you' d like to match, and then use Table.FindText to bring in the matching rows instead of Table.Join.

 

Again, this is not very elegant, and it's pretty late, but like I said, any of the pros on here can probably improve upon this code once they get my point.  Hope any of this makes sense, but the kids are upstairs like it's noon, and it's 1:43 AM, better see ehat's going on up there!

 

--Nate

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors