Re: Merge 2 tables without creating duplicates with Power Query
If I understand correct, you want to Left Outer join Table 1 and Table 2 on both the Emp Id and Dept Columns.
To do this, hold the control key and click 'Emp ID' in Table 1, 'Emp ID' in Table 2, 'Dept' in Table 1 then 'Dept' in Table 2. You should then see small numbers appearing at on the column headers to show what is being matched to what.
Remember to expand the 'Table2' columns in Power Query editor to show attributes 4,5 and 6.
<<< If you have valued anyone's contributions in this thread, please click * to thank them for their efforts
Re: Merge 2 tables without creating duplicates with Power Query
If you do it with just the EmpID, it will duplicate unless they are matched on a unique basis between the tables. For example, just EmpID 1 will match all the following rows when you expand to show attributes 4,5 and 6:
In which case, you need to match on two columns to make them match on a unique basis. Using my approach on your sample data it matched your expected output exactly. Perhaps there are other differences in your original dataset?
Bookmarks