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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Look up values based on 2 conditions. one of which is fuzzy match

Hello,

 

I have 2 tables:

 

Table 1 contains cost stations codes and cost stations names in SAP. The cost stations can be repeated if there are many sections underneath this cost station:

 

Cost station codesCost station names
5271Factory 1 - Vegetable processing section
5271Factory 1 - Meat processing section
5831Factory 3 - Meat packaging

 

Table 2 contains cost station codes, cost stations names and index in a different in-house system. The cost station codes are the same with Table 1 but the cost station names are diffrent. The cost station names are also not following any rules. Index is unique.

 

Cost station codesCost station namesIndex
5271Vegetable processing unit/Factory 11
5271Meat processing unit - factory 12
5831Factory 3 - Meat package3

 

I want to have another column of Index added to Table 1.

 

Edit: I want to get the Index lookup that takes into consideration Cost Station Names because the Cost Station Codes are not unique for both tables. If Cost Station Names from Table 1 is similar (fuzzy match) to Cost Station Names from Table 2, check if the cost station codes matches. If they do then get index of the match, else look up only Cost Station Code

 

Edit: I want that the Cost Station Code must exactly match and the Names can "kind of" match.

 

How can I achieve this? 

 

Thank you in advance 🙂 

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

Hello - this gets the job done.  

 

You can merge the tables using fuzzy match.  In order to match on Cost Station Code as one of the criteria, it must be formatted as text.  Then you can match on both columns and select the additional fuzzy match options.  I have included a sample pbix.

 

jennratten_0-1631548768643.png

 

Table1 final result:

jennratten_1-1631548798043.png

 

Merge Tables Using Multiple Columns and Fuzzy Matching.pbix  

jennratten
Super User
Super User

Hello - this gets the job done.  

 

You can merge the tables using fuzzy match.  In order to match on Cost Station Code as one of the criteria, it must be formatted as text.  Then you can match on both columns and select the additional fuzzy match options.  I have included a sample pbix.

 

jennratten_0-1631548768643.png

 

Table1 final result:

jennratten_1-1631548798043.png

 

Merge Tables Using Multiple Columns and Fuzzy Matching.pbix  

Anonymous
Not applicable

Hello,

 

Thank you very much for your reply. I have tried this way but turns out a lot of the fuzzy matches also matches with the wrong codes, which must be exact matches. I have tried to increase/decrease the threshold but it also does not result in very correct matches.

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.