Excel Course
Merging Tables in Power Query
Merging is Power Query's answer to VLOOKUP — but done properly. Where VLOOKUP retrieves one value at a time and breaks when columns move, a Power Query merge joins two entire tables on a matching key column and brings across as many columns as you need, all at once, automatically, on every refresh. If you have ever built a report that required fifteen VLOOKUP columns pulling from a reference table, merging in Power Query will feel like a revelation. This lesson covers all six join types and the practical patterns you will use most.
What Is a Merge?
A merge combines two queries — a left table and a right table — by matching rows on one or more key columns. The result is a new query where each row from the left table gains additional columns from the right table wherever the key values match. You control how unmatched rows are handled by choosing a join type.
| Emp ID | Sales |
|---|---|
| 1001 | £119,000 |
| 1002 | £93,000 |
| 1003 | £117,000 |
| 1004 | £82,000 |
| Emp ID | Name | Department |
|---|---|---|
| 1001 | Priya | Finance |
| 1002 | Sarah | Operations |
| 1003 | James | Sales |
| 1005 | Maria | HR |
| Emp ID | Sales | Name | Department |
|---|---|---|---|
| 1001 | £119,000 | Priya | Finance |
| 1002 | £93,000 | Sarah | Operations |
| 1003 | £117,000 | James | Sales |
| 1004 | £82,000 | null | null |
The Six Join Types
The join type controls what happens to rows that do not have a match in the other table. Power Query offers all six standard database join types. Understanding which to use is the key skill in merging — the data you get back changes completely depending on your choice.
| Join Type | What it returns | Use for |
|---|---|---|
| Left Outer ★ | All left rows · matching right columns (null where no match) | Adding lookup columns — keep all original rows regardless of match |
| Right Outer | All right rows · matching left columns (null where no match) | When the right (reference) table must be fully preserved |
| Full Outer | All rows from both tables (null wherever there is no match) | Seeing everything — comparing two lists for gaps on either side |
| Inner | Only rows that match in both tables | Clean output with no nulls — only confirmed matching records |
| Left Anti | Left rows with NO match in the right table | Finding records missing from the reference — orphan row detection |
| Right Anti | Right rows with NO match in the left table | Finding reference items that have no transactions — unused records |
Join Type Visual — Same Two Tables, Different Results
How to Perform a Merge — Step by Step
Step 1 — Open the left query in Power Query Editor
(the table you want to add columns to)
Step 2 — Home → Merge Queries
(or Merge Queries as New to keep the original untouched)
Step 3 — In the Merge dialog:
Top table: your left query (already selected)
Bottom table: choose the right query from the dropdown
Click the key column in the top table
Click the matching key column in the bottom table
Choose your Join Kind
Step 4 — Click OK
Power Query adds a new column on the right containing "Table" objects
Step 5 — Expand the merged column
Click the expand icon (⤢) on the new column header
Untick "Use original column name as prefix" (usually cleaner)
Select only the columns you need from the right table
Click OK
Step 5 — expanding the merged column — is the one people most often miss or mishandle. After the merge, Power Query does not immediately show you the values from the right table. It shows a column of Table objects, each one containing the matching rows from the right. Clicking the expand icon opens a selector where you choose which right-table columns to bring across. If you forget to untick "Use original column name as prefix," all your new columns will have names like "EmployeeRef.Name" instead of just "Name."
Merging on Multiple Key Columns
Sometimes a single column is not enough to uniquely identify a match — for example, when joining by both Region and Quarter together. Power Query supports multi-column merges: simply click the first key column, then Ctrl+click the second key column in both the top and bottom tables. The order of selection must match between the two tables.
Left table: Region, Quarter, Sales
Right table: Region, Quarter, Target
Multi-column merge key: Region + Quarter (both must match)
In the Merge dialog:
Click "Region" in the top table → shows (1)
Ctrl+click "Quarter" in top → shows (2)
Click "Region" in the bottom table → shows (1)
Ctrl+click "Quarter" in bottom → shows (2)
Result: each row matched on the combination of Region AND Quarter.
"North Q1" only matches "North Q1" — not "North Q2" or "East Q1".
| Region | Quarter | Sales | Target ← merged | vs Target |
|---|---|---|---|---|
| North | Q1 | £119,000 | £100,000 | +£19,000 |
| North | Q2 | £93,000 | £100,000 | -£7,000 |
| East | Q1 | £117,000 | £90,000 | +£27,000 |
Merge vs Append — Knowing the Difference
Merging and appending are both ways to combine two queries, but they do completely different things. Merging joins tables horizontally — it adds columns from the right table to the left. Appending stacks tables vertically — it adds rows from the second table below the first. This is the same distinction as HSTACK vs VSTACK in formulas.
🟠 Practice
Q1. You have a Sales table and an Employee reference table. You want to add the employee Name and Department to every row in the Sales table. Some sales rows may not have a matching employee. Which join type should you use and why?
Q2. You want to find all Employee IDs in your Sales table that do NOT exist in the Employee reference table. Which join type returns exactly those rows?
Q3. After performing a merge, a new column appears in the preview showing "Table" in every row. What do you need to do to see the actual values from the right table?
🟣 Quiz
Q1. What is the difference between Merge Queries and Append Queries in Power Query?
Q2. You perform a Left Outer merge between a Sales table (100 rows) and a Products reference table. The result has 143 rows. What most likely caused this?
Q3. You want to merge two tables on a combination of Region AND Quarter — not just one column. How do you select both key columns in the Merge dialog?
Next up — Automation in Power Query, where you will learn how to schedule refreshes, manage data source connections, and build queries that keep your reports completely up to date without any manual intervention.