Excel Power Query: Combine Queries Explained

How-to basics · Updated November 21, 2026

In Excel Power Query, combine queries with Append to stack rows from similar tables, or Merge to match rows using one or more shared columns. Open the Power Query Editor, choose the relevant command on its Home tab, select the queries and settings, then load or refresh the result.

Append or merge: what is the difference?

Appending adds the rows of one query to another, much like placing one table below a second table. It is useful when separate worksheets, files, or monthly extracts contain the same kind of records. For example, append January sales to February sales to create one longer sales table.

Merging combines information from two queries by matching values in key columns. It is similar to a lookup: match each order to a customer record using CustomerID, for instance, and then expand the customer name or region into the order data. The original rows in the first query generally remain the starting point, depending on the join type you choose.

  • Append: combine rows from tables with comparable columns.
  • Merge: combine columns or related details by matching key values.

These commands do not alter the source worksheets. Power Query records transformation steps and produces a query result, which you can load to a worksheet or the Data Model.

How to append queries in Excel

First create or import the queries you want to stack. In Excel for Microsoft 365 on Windows, select a cell in an Excel table and use Data > From Table/Range to create a query, or use the options under Data > Get Data to import another source. In the Power Query Editor, use these steps:

  1. On the Home tab, select Append Queries to add rows to the current query, or open its menu and choose Append Queries as New to create a separate result query.
  2. Choose Two tables or Three or more tables, as appropriate.
  3. Select the query names to include. For three or more tables, add each required query to the list.
  4. Select OK, review the preview, and rename the result query to something recognizable, such as All Sales.
  5. Choose Home > Close & Load, or use the Close & Load options to select a destination.

Appending as a new query is often preferable when you want to keep the original queries available for other reports. Appending into the current query is useful when that query is intended to become the combined result. Neither choice deletes or rewrites the source data.

How Power Query matches columns when appending

Power Query aligns appended fields by column name, not by their left-to-right position. If one query has columns named Date and Amount while another has Amount and Date in the opposite order, Power Query puts values under the matching names. Columns that exist in only one query still appear in the result; rows from a query without that field receive a null value in that column.

This makes append flexible, but it also means inconsistent headers can create unwanted fields. If one table calls a field Customer and another calls it Customer Name, Power Query treats those as different columns unless you standardize the names first. Review the preview and column headings before loading.

For reliable results, prepare each source so that headers describe the same information, remove title rows or footers, and set compatible data types. A number stored as text in one query and as a numeric value in another can lead to mixed types or later calculation problems. In the Editor, select a column and use the data type control on the Transform or Home tab to set an appropriate type.

How to merge queries

To merge, open the Power Query Editor and select the query that will provide the primary rows. On the Home tab, choose Merge Queries, or choose Merge Queries as New if you want the result in a separate query. In the merge window:

  1. Choose the second query from its drop-down list.
  2. Select the matching column in the first preview, then select its corresponding column in the second preview. For a multi-column key, select the columns in the same order in both previews, using Ctrl-click on Windows.
  3. Choose a join kind, such as Left Outer, and select OK.
  4. In the resulting column of nested tables, select the expand button in the column header. Choose which fields to add, and decide whether to keep the source column-name prefix.

For example, an Orders query might contain OrderID, CustomerID, and Total, while a Customers query contains CustomerID, Name, and Region. Merge Orders with Customers on CustomerID, then expand Name and Region. The output keeps the order details and adds the matched customer fields, subject to the chosen join kind.

Choose the right join kind

The join kind controls which rows survive a merge. The most common choice for adding lookup information is Left Outer: keep every row from the first query and bring in matching rows from the second. If a key has no match, the expanded fields from the second query are null.

  • Left Outer: all rows from the first query and matching rows from the second.
  • Right Outer: all rows from the second query and matching rows from the first.
  • Full Outer: all rows from both queries, with nulls where there is no match.
  • Inner: only rows with a match in both queries.
  • Left Anti or Right Anti: rows from one side that have no match on the other side. These can help identify missing keys.

A merge can return more rows than expected if the second query contains repeated key values. If a single order matches three customer rows with the same CustomerID, expanding the merge can produce three output rows for that order. Check whether the lookup key is unique when you expect one match per record. Also check that the selected columns represent the same identifier, rather than merely having similar-looking values.

Use references and keep queries organized

A query can serve as a reusable preparation step. For example, import each monthly file as its own query, standardize its column names and data types, then append the prepared queries into a combined table. You can also create a reference to a query when you want a new query to use its result as a starting point. In the Queries pane, right-click a query and choose Reference; the new query depends on the original but can have its own additional steps.

Clear names make dependencies easier to understand. Names such as Raw January, Clean January, and All Sales are more informative than Query1, Query2, and Query3. Keep source or staging queries separate from final output queries when that structure makes the workflow easier to maintain. A change to an upstream query can affect every query that depends on it.

Common problems and how to fix them

  • The appended result has unexpected columns: compare headers across sources and standardize spelling, spaces, and naming before appending. Similar meaning does not make two differently named columns identical.
  • A merge shows nulls after expansion: check that the key columns are the correct pair and have compatible data types. Look for leading or trailing spaces, inconsistent formatting, missing values, and identifiers stored as text in one source but numbers in another.
  • The merged result has duplicate rows: inspect the matching key in the second query. Repeated key values can create multiple matches. If the business rules call for one row per key, resolve duplicates or summarize the lookup data before merging.
  • The result is missing records: confirm the join kind. An Inner join drops records without a match; a Left Outer join keeps all records from the first query.
  • Refresh produces an error: check whether a source file moved, a table or sheet was renamed, or a column used in a step disappeared. Power Query replays its steps against the current source structure, so a changed source can break a later step.

When investigating, select each step in the Applied Steps pane and inspect the preview. This helps identify the first step where the data becomes incorrect, rather than trying to diagnose the final table alone.

Refresh, load, and platform considerations

After loading a query, refresh it to rerun the recorded steps against its source. Use Data > Refresh All in Excel to refresh workbook connections and queries, or open Data > Queries & Connections to manage individual queries and view connection details. Refresh behavior depends on the source being available and, for files, remaining at the expected location.

Power Query results can be loaded to a worksheet table or, where appropriate, to the Data Model. A worksheet is convenient for inspection and ordinary table-based work; the Data Model is useful when working with larger related datasets and supported analysis features. Loading every intermediate query to a sheet is not necessary. Use the load options to keep staging queries as connections when that suits the workbook.

The instructions above describe Excel for Microsoft 365 on Windows. Power Query is also available in Microsoft 365 for Mac, but supported sources and editing capabilities can differ, and the ribbon layout may vary. Excel for the web has more limited Power Query authoring capabilities than desktop Excel; use the Windows desktop app if a command or connector is unavailable in your environment.

Append or merge versus other approaches

Use Power Query when you need a repeatable process for combining data that changes over time. Unlike manually copying and pasting, a query preserves transformation steps so a refresh can bring in updated source data. Unlike a worksheet lookup formula, a merge creates a transformed query result and can combine tables using several key columns and different join types.

For a small, one-time task, copying rows or using a lookup formula may be quicker. For recurring imports, multiple files, cleanup steps, or a clear audit trail, Power Query is usually easier to maintain. It is not a substitute for fixing source-data quality: duplicate identifiers, inconsistent headers, and incorrect data types still need deliberate handling.

Frequently Asked Questions

Does append combine columns or rows?

Append combines rows. It aligns fields by column name and creates the union of the columns found across the selected queries. Use Merge when you want to match records and add fields from another query.

Can I append more than two queries?

Yes. Choose the Three or more tables option in the Append dialog, then add the queries you want to combine. You can also build a result through successive append steps.

Why does Power Query add nulls after an append?

A null commonly appears when a source query does not contain a column that exists in another appended query. It can also indicate a blank source value. Check the column names and inspect the original query to distinguish the two cases.

Which merge join should I use for a lookup?

Left Outer is a common lookup choice when the first query contains the records you want to preserve. It keeps all its rows and adds matching information from the second query. Choose another join kind when you specifically need only matches or unmatched records.

Do Power Query changes update the original worksheet?

No. Query transformations produce a separate result; they do not edit the source worksheet table. Refresh reads the source again and updates the query output, provided the source remains accessible.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.