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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
balajideshpande
Regular Visitor

Compare 3 columns with Names in different Table and get required result

Hello All, 


I have 3 different tables/ sheets

 

1st one

First Name Last NameSales
Manmohan Singh50
Rajnath Bendre25
Mohammad Abdul30

 

2nd one

Lastname FirstnameSpent
Singh Manmohan25
Bendre Rajnath15
Abdul Mohammad

10

 

3rd one

 

FirstnameTarget
Manmohan100
Rajnath80
Mohammad75

 

 

Result I need is 

 

NameSalesSpentTarget
Manmohan Singh5025100
Rajnath Bendre251580
Mohammad Abdul301075

 

Can you please help?

1 ACCEPTED SOLUTION
Mahesh0016
Super User
Super User

@balajideshpande I hope this helps you! Thank You!!

>Merge query with Fuzzylookup.

Mahesh0016_0-1690973153446.png

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8k3My83PSMxTCM7MS89Q0lEyNVCK1YlWCkrMykssyVBwSs1LKUoFihuZgsV9gYpzcxNTFByTUkpzgOLGQPWxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"First Name Last Name" = _t, Sales = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"First Name Last Name", type text}, {"Sales", Int64.Type}}),
    #"Merged Queries" = Table.FuzzyNestedJoin(#"Changed Type", {"First Name Last Name"}, #"Table B", {"Lastname Firstname"}, "Table B", JoinKind.LeftOuter, [IgnoreCase=true, IgnoreSpace=true]),
    #"Expanded Table B" = Table.ExpandTableColumn(#"Merged Queries", "Table B", {"Spent"}, {"Table B.Spent"}),
    #"Merged Queries1" = Table.FuzzyNestedJoin(#"Expanded Table B", {"First Name Last Name"}, #"Table C", {"Firstname"}, "Table C", JoinKind.LeftOuter, [IgnoreCase=true, IgnoreSpace=true, Threshold=0.5]),
    #"Expanded Table C" = Table.ExpandTableColumn(#"Merged Queries1", "Table C", {"Target"}, {"Table C.Target"})
in
    #"Expanded Table C"

 

 

View solution in original post

1 REPLY 1
Mahesh0016
Super User
Super User

@balajideshpande I hope this helps you! Thank You!!

>Merge query with Fuzzylookup.

Mahesh0016_0-1690973153446.png

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8k3My83PSMxTCM7MS89Q0lEyNVCK1YlWCkrMykssyVBwSs1LKUoFihuZgsV9gYpzcxNTFByTUkpzgOLGQPWxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"First Name Last Name" = _t, Sales = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"First Name Last Name", type text}, {"Sales", Int64.Type}}),
    #"Merged Queries" = Table.FuzzyNestedJoin(#"Changed Type", {"First Name Last Name"}, #"Table B", {"Lastname Firstname"}, "Table B", JoinKind.LeftOuter, [IgnoreCase=true, IgnoreSpace=true]),
    #"Expanded Table B" = Table.ExpandTableColumn(#"Merged Queries", "Table B", {"Spent"}, {"Table B.Spent"}),
    #"Merged Queries1" = Table.FuzzyNestedJoin(#"Expanded Table B", {"First Name Last Name"}, #"Table C", {"Firstname"}, "Table C", JoinKind.LeftOuter, [IgnoreCase=true, IgnoreSpace=true, Threshold=0.5]),
    #"Expanded Table C" = Table.ExpandTableColumn(#"Merged Queries1", "Table C", {"Target"}, {"Table C.Target"})
in
    #"Expanded Table C"

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors