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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
nelsonwynn
Frequent Visitor

Match ID that contains in another Table

I'm a beginner of Power BI. I would like to know how can I match two tables which have IDs are not same. Please kindly see the following example.

 

Table 1 ->

nelsonwynn_0-1720515378368.png

Table2 ->

 

nelsonwynn_1-1720515385642.png

The result I want ->

 

nelsonwynn_2-1720515392506.png

Thank you so much.

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @nelsonwynn - you can merge the two tables in power query editor with Name is common column in both use left outer join

 

rajendraongole1_0-1720514983989.png

 

expand the table with ID column later add a custom column as below:

rajendraongole1_1-1720515046586.png

 

 

if [ID]= null then "Missed" else "Matched"

 

rajendraongole1_2-1720515075559.png

 

final output:

rajendraongole1_3-1720515125934.png

 

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8i9KSS1SyExR0lHyS8xNBVKOufmleSVKsTrRSoYGBoZAEZfEMrACUwMDmLARkOudmlOWmQdkmCHEjYHc4JLUslSQuDlC3ATIDUpMzkjNATIsEOKmIPH8YpC9liDRWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Tab1 = _t, #"(blank)" = _t, #"(blank).1" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Tab1", type text}, {"(blank)", type text}, {"(blank).1", type text}}),
#"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Order id", Int64.Type}, {"Name", type text}, {"Amount", Int64.Type}}),
#"Merged Queries" = Table.NestedJoin(#"Changed Type1", {"Name"}, T2, {"Name"}, "T2", JoinKind.LeftOuter),
#"Expanded T2" = Table.ExpandTableColumn(#"Merged Queries", "T2", {"ID", "Name"}, {"ID", "Name.1"}),
#"Added Custom" = Table.AddColumn(#"Expanded T2", "Custom", each if [ID]= null then "Missed" else "Matched"),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Name.1"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Custom", "Status"}})
in
#"Renamed Columns"

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

4 REPLIES 4
rajendraongole1
Super User
Super User

Hi @nelsonwynn - you can merge the two tables in power query editor with Name is common column in both use left outer join

 

rajendraongole1_0-1720514983989.png

 

expand the table with ID column later add a custom column as below:

rajendraongole1_1-1720515046586.png

 

 

if [ID]= null then "Missed" else "Matched"

 

rajendraongole1_2-1720515075559.png

 

final output:

rajendraongole1_3-1720515125934.png

 

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8i9KSS1SyExR0lHyS8xNBVKOufmleSVKsTrRSoYGBoZAEZfEMrACUwMDmLARkOudmlOWmQdkmCHEjYHc4JLUslSQuDlC3ATIDUpMzkjNATIsEOKmIPH8YpC9liDRWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Tab1 = _t, #"(blank)" = _t, #"(blank).1" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Tab1", type text}, {"(blank)", type text}, {"(blank).1", type text}}),
#"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Order id", Int64.Type}, {"Name", type text}, {"Amount", Int64.Type}}),
#"Merged Queries" = Table.NestedJoin(#"Changed Type1", {"Name"}, T2, {"Name"}, "T2", JoinKind.LeftOuter),
#"Expanded T2" = Table.ExpandTableColumn(#"Merged Queries", "T2", {"ID", "Name"}, {"ID", "Name.1"}),
#"Added Custom" = Table.AddColumn(#"Expanded T2", "Custom", each if [ID]= null then "Missed" else "Matched"),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Name.1"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Custom", "Status"}})
in
#"Renamed Columns"

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Oh sorry, I make mistake from sample data. I would like to join with the ID. the data is like that. I'll repair my sample data. Thank you.

Hi @nelsonwynn -Great!!

 

If i did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @rajendraongole1 ,

 

Thank you so much for your answer.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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