Combine Queries: Merge, Append & Parameters
Stack tables on top of each other (append), join them side by side (merge), and use a parameter so one value controls them all.
What you will learn
- Append queries to stack rows from several tables
- Merge queries to join columns by a matching key
- Use a query parameter and the reference-vs-duplicate choice
Real ETL is more than cleaning one file
Earlier you cleaned a single CSV in Power Query. On a real job you usually have to combine data first — stacking this year’s file under last year’s, or pulling a customer’s city onto each sale. The word for all of this prep work is ETL: Extract (get the data), Transform (clean and combine it), Load (send it to the model). This lesson covers the two combining moves every analyst needs — append and merge — plus two time-savers, parameters and reference queries.
Both combining moves live on the Home ribbon of the Power Query Editor, under Combine. Let us define the two clearly before doing each one.
| Move | What it does | Think of it as |
|---|---|---|
| Append | Stacks rows of one table under another | Adding more rows (taller table) |
| Merge | Brings columns from another table beside this one, matched by a key | Adding more columns (wider table) |
A simple memory hook: append makes a table taller (more rows), merge makes it wider (more columns). Pick the one that matches the shape you need.
Append — stack same-shaped tables
Imagine two files with the exact same columns: Sales2025 and Sales2026. To analyse them together you want them as one table. Append puts the 2026 rows directly under the 2025 rows. Here is exactly what you click:
- In Power Query, click Home → Append Queries → Append Queries as New.
- Choose the first table (
Sales2025) and the second (Sales2026). - Click OK — a new query appears with every row from both.
Sales2025 (120 rows) Sales2026 (140 rows)
Date Product Amount Date Product Amount
--- Append ---->
AllSales (260 rows) = 2025 rows, then 2026 rows underneathNote: Output: A new query named AllSales holds 260 rows — the 120 from 2025 followed by the 140 from 2026, because both tables share the same columns. Now a single line chart can show the full two-year trend. Append needs the columns to line up by name; any column that exists in only one table is filled with blanks for the other table’s rows.
Merge — join columns by a matching key
Merge is different: it brings columns from another query and lines them up by a matching key (a shared column), just like a database join. Say your Sales table has a CustomerID but no city, and a Customers table has CustomerID and City. Merge pulls City onto each sale.
- Click Home → Merge Queries.
- Pick the left table (
Sales) and click its CustomerID column to select the key. - Pick the right table (
Customers) and click its CustomerID column. - Choose a join kind (start with Left Outer — keep all Sales rows), then OK.
- A new column appears; click its expand (↔) icon and tick City to pull it in.
Sales Customers
CustomerID Amount CustomerID City
7 1200 7 Delhi
12 450 12 Pune
--- Merge on CustomerID (Left Outer) --->
Sales (now with City)
CustomerID Amount City
7 1200 Delhi
12 450 PuneNote: Output: Each sale now carries its customer’s City, looked up by the shared CustomerID. A “Left Outer” join keeps every Sales row even if a customer is missing (City just shows blank for those). Merge happens here in Power Query, before the model — useful when you want one flat table; a model relationship (from the data-model lesson) does a similar lookup at report time instead.
| Join kind | Keeps | Use when |
|---|---|---|
| Left Outer | All left rows + matches | The usual choice — keep every sale |
| Inner | Only rows that match on both sides | You want only sales with a known customer |
| Full Outer | All rows from both sides | You need everything, matched or not |
Reference vs Duplicate — reuse without re-cleaning
Sometimes you want a second version of a query — say a summary built from a cleaned table. Right-clicking a query offers two options that sound alike but differ:
- Duplicate: makes an independent copy with its own copy of all the steps. Change the original and the copy does not follow.
- Reference: makes a new query that points back to the original and starts from its result. Fix a step in the original and every reference updates too.
Use Reference when several queries should share the same cleaning — clean once in a base query, then reference it for each summary. Use Duplicate when you want a true fork that can drift apart.
Parameters — one value, controlled in one place
A parameter is a named, reusable value you define once and plug into many places — a file path, a year, a server name. Change the parameter and everything using it updates. To make one: Home → Manage Parameters → New Parameter, give it a name (e.g. SourceYear) and a value (e.g. 2026).
Parameter: SourceYear = 2026
Used in a filter step: Keep rows where Year = SourceYear
Change the parameter to 2025 -> every query using it now reads 2025Note: Output: With SourceYear set to 2026, the report shows 2026 data. Switch the parameter to 2025 in one place and click Refresh — every step that referenced SourceYear now filters to 2025, with no hunting through individual queries. Parameters are how teams point the same report at a test folder vs a live folder, or at one year vs another, by editing a single value.
Tip: Plan the order: append first to get all the rows together, then merge to enrich them with lookup columns, then clean. Build a base query, reference it for summaries, and steer the whole thing with parameters — that is a tidy, professional ETL setup.
Watch out: For Append, column names must match across tables or the rows misalign and you get extra half-empty columns. For Merge, make sure the key column has the same data type on both sides (text-vs-number mismatches silently match nothing), and prefer Left Outer so you never lose rows by accident.
Q. You have two CSVs with the same columns — one for 2025, one for 2026 — and want them as a single taller table. Which Power Query move do you use?
✍️ Practice
- Append two same-shaped CSVs into one query and confirm the row count is the sum of both.
- Merge a Sales query with a Customers query on CustomerID and expand the City column.
🏠 Homework
- Create a parameter (e.g. a year or a folder path), use it in a filter or source step, then change the parameter value and Refresh to confirm every dependent query updates.