Power BI Merge and Append Queries
Real projects rarely arrive in one neat table. Sales may sit in twelve monthly files, and customer names may live in a separate list. Power Query offers two tools for combining data: Append stacks tables on top of each other, and Merge places tables side by side using a matching column.
The Paper Analogy
Append works like stacking printed sheets into one pile. Each sheet has the same columns, and the pile grows taller. Merge works like stapling a name card to each order slip after matching the customer number on both papers.
APPEND (more rows) MERGE (more columns)
Jan table Orders Customers
+----+------+ +----+----+ +----+-------+
| ID | Amt | | ID | C# | | C# | Name |
+----+------+ +----+----+ +----+-------+
Feb table ==> one | 1 | 7 | + | 7 | Rhea |
+----+------+ long table +----+----+ +----+-------+
| ID | Amt | |
+----+------+ v
ID | C# | Name
1 | 7 | Rhea
Append Queries
Append suits tables with identical or near-identical columns. Monthly exports, yearly archives, and regional files are typical cases. Power Query matches columns by name, so the order of columns does not matter. Missing columns fill with null values.
Steps to Append
- Open Power Query Editor from the Home tab.
- Select Append Queries on the Home ribbon.
- Choose Two tables or Three or more tables.
- Pick the tables and select OK.
Choose Append Queries as New to keep the original queries untouched. The new query holds the combined result.
Merge Queries
Merge brings columns from a second table into the first. Both tables need a matching column, such as Customer ID. The match works like the VLOOKUP formula in Excel, with far more control.
Steps to Merge
- Select the main table in Power Query Editor.
- Choose Merge Queries on the Home ribbon.
- Select the second table from the drop-down list.
- Click the matching column in each table.
- Pick a Join Kind and select OK.
- Expand the new column to choose which fields to keep.
Join Kinds Explained
| Join Kind | Result |
|---|---|
| Left Outer | All rows from the first table, matches from the second |
| Right Outer | All rows from the second table, matches from the first |
| Full Outer | All rows from both tables |
| Inner | Only rows that match in both tables |
| Left Anti | Rows in the first table with no match in the second |
| Right Anti | Rows in the second table with no match in the first |
Left Outer fits most everyday needs. Left Anti shines when you hunt for gaps, such as customers who never placed an order.
Worked Example: Finding Customers with No Orders
A gym keeps a Members table with 500 rows and a Visits table with check-in records. The manager wants a list of members who never visited. A Merge with Members as the first table, Visits as the second, and the Left Anti join kind returns exactly those members.
Members (500) --Left Anti on Member ID-- Visits
|
v
Members with zero visits (e.g. 38 rows)
Tips for Clean Results
- Match data types on both key columns. Text 101 and number 101 never match.
- Trim spaces and fix capitalization before merging.
- Remove duplicate keys from lookup tables to prevent extra rows.
- Keep key columns only. Extra columns slow refresh.
Key Points
- Append stacks rows from tables that share the same structure.
- Merge adds columns by matching a key column between two tables.
- Left Outer covers most merges, and Left Anti finds missing matches.
- Matching data types on key columns prevents silent failures.
