Merge Columns from 2 Tables only if value is in both columns

scojax22

New Member
Joined
Apr 1, 2014
Messages
12
Office Version
  1. 365
Platform
  1. Windows
I have 2 tables with multiple columns in each, but one common column - names. I want to create a new table with just the names column, only where the name is in both tables/columns. Something like this:


Table 1Table 2New Table
JoeBillJoe
BobTimmyRay
RayJoe
BenJay
JimWill
BarryRay


I am trying to do this is Power BI
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
A simple Inner merge will do it. Take a look:
1682099381679.png

After bringing Table1 and Table2 into Power Query, do the merge. This is a Merge as a New query, but it could be done in either table:
Power Query:
let
    Source = Table.NestedJoin(Table1, {"Table 1"}, Table2, {"Table 2"}, "Table2", JoinKind.Inner),
    RemovedColumn = Table.RemoveColumns(Source,{"Table2"}),
    RenamedColumn = Table.RenameColumns(RemovedColumn,{{"Table 1", "New Table"}})
in
    RenamedColumn
Book1
ABCDE
1Table 1Table 2New Table
2JoeBillJoe
3BobTimmyRay
4RayJoe
5BenJay
6JimWill
7BarryRay
Sheet1
 
Upvote 0
Solution
Thanks for the reply.
If the suggestion worked for you then please mark that post as the solution. If no post has answered your question then please do not mark one as the solution. I have removed the solution mark from post #3.
 
Upvote 0

Forum statistics

Threads
1,223,955
Messages
6,175,605
Members
452,660
Latest member
Zatman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top