Merging data from two tables into one table
There will be instances where you have data split across two tables but need them just in one table. For people with SQL knowledge, this is often achieved with an SQL JOIN
clause. There are different types of joins: inner join, left outer join, right outer join, self join, cross join, and so on. In Power Query, Merge Query achieves many of these joins in a very easy-to-understand way.
As an example, we will merge data in the employees table we just worked on and a payroll table. You can access the practice files in the companion folder. The filename is Merge Data.xlsx
.
Load the data from the two sheets in the file into Power Query. Go to the Home menu and click on Merge Queries as New. See the following screenshot:
Figure 4.32 – Merge Queries as New table in Power Query
In the Merge pane that comes up, select Employees Data as the first table and Payroll as the second table. The order is actually...