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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
ethanlsaul
Helper I
Helper I

Approx Match 2 Sources Relationship

Hello,

 

I have 2 data sources that i'd like to connect on UPC. 

 

One source has 10 characters while the other has an 11th (check digit).

 

Example 1:

 

Source A:

7430000070

Soruce B:

74300000701

 

Example 2:

38137003664

Source b:

381370036647

 

The trick part is some Source A codes are 10 digits while others are 11. I tried cutting off the 11th to make them all 10 and it errored out because the last digit can make a different between products. 

 

Ideal solution: Like in Excel, we use approximate matches. Is that possible? I need to create a relatinoship between source A and B. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ethanlsaul ,

 

Here I suggest you to add a calculated column in Source B to help relate two tables.

Approx Match = 
VAR _LEN = LEN('Source B'[Column1])
RETURN
LEFT('Source B'[Column1],_LEN - 1)

RicoZhou_0-1659342459439.png

Result is as below.

RicoZhou_1-1659342472939.png

 

Best Regards,
Rico Zhou

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @ethanlsaul ,

 

Here I suggest you to add a calculated column in Source B to help relate two tables.

Approx Match = 
VAR _LEN = LEN('Source B'[Column1])
RETURN
LEFT('Source B'[Column1],_LEN - 1)

RicoZhou_0-1659342459439.png

Result is as below.

RicoZhou_1-1659342472939.png

 

Best Regards,
Rico Zhou

 

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

lbendlin
Super User
Super User

Use Table.AddColumn() with a custom generator function . There you can merge tables based on the first ten characters that match etc.

 

Please provide sanitized sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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