Excel Power Query Merge Two Queries: Step-by-Step

How-to basics · Updated November 22, 2026

To merge two queries in Excel Power Query, go to the Home tab in the Power Query Editor, select the first query, click Merge Queries, choose the second query, select matching columns, pick a join kind, and click OK. The merge creates a new query with a nested table column that you expand to bring in the fields you need.

What Is Power Query Merge and Why Use It

Power Query is Excel’s data transformation tool, available in Excel 2016 and later, and fully integrated in Microsoft 365. Merging two queries combines rows from two tables based on a common column, similar to a SQL JOIN or Excel VLOOKUP but more flexible. You use merge when you need to bring related data together—for example, adding customer names to an orders table, or attaching product categories to a sales list. Unlike VLOOKUP, Power Query merge works with large datasets, handles multiple match columns, and lets you choose from six join types. It also refreshes automatically when source data changes, making it a core skill for anyone building reports in Excel.

How to Merge Two Queries in Power Query Editor

Here are the exact steps for Excel for Microsoft 365 on Windows. On Mac, the ribbon paths are the same, but the Merge button is under the Add Column tab in some versions—check the Home tab first.

  1. Load both data sources into Power Query: select each table or range, go to Data > From Table/Range (or Data > Get Data for external sources). Each becomes a query in the Queries pane.
  2. Open the Power Query Editor by clicking Data > Launch Power Query Editor.
  3. Select the first query (the one you want as the base).
  4. On the Home tab, click Merge Queries. If you have multiple queries, choose Merge Queries as New to keep the original queries intact.
  5. In the dialog, select the second query from the dropdown.
  6. Click on the column in the first query, then click the matching column in the second query. You can Ctrl-click to select multiple columns for a composite key.
  7. Choose a Join Kind from the dropdown (see next section).
  8. Click OK. The preview shows a new column named after the second query, containing tables.
  9. Click the expand icon (double arrow) in that column header, select the columns you want, uncheck “Use original column name as prefix” if you prefer clean names, and click OK.
  10. Click Close & Load to load the merged query into a worksheet, or Close & Load To to choose the destination.

If the column names differ between queries, that’s fine—you select the columns manually, not by name.

Choosing the Right Join Kind

The join kind determines which rows appear in the result. Power Query offers six options, but two are most common:

  • Left Outer – all rows from the first query, plus matching rows from the second. Non-matches show null. Use this when the first query is your primary list.
  • Inner – only rows that have matches in both queries. Use this to filter out records without a corresponding match.
  • Full Outer – all rows from both queries, with nulls where no match exists.
  • Left Anti – rows only in the first query that have no match in the second. Useful for finding missing items.
  • Right Anti – rows only in the second query with no match in the first.
  • Right Outer – all rows from the second query plus matching from the first (the reverse of Left Outer).

For most reporting, you’ll use Left Outer to keep all base records. If you need to exclude unmatched rows, use Inner. The anti joins are great for data cleaning—for example, finding orders with no customer record.

Common Problems and How to Fix Them

Merging often fails or gives unexpected results. Here are the typical issues:

  • Data type mismatch: If one column is text and the other is number, merge won’t match. Fix by selecting the column and changing the data type in the Transform tab, or by using Text.From or Number.From in a custom column.
  • Leading/trailing spaces: Extra spaces break matches. Use Transform > Format > Trim on both columns before merging.
  • Duplicate keys: If the second query has duplicate values in the key column, the merge creates multiple rows for each match. Check with Group By or Remove Duplicates on the second query if you expect unique keys.
  • Case sensitivity: Power Query merge is case-insensitive by default. If you need case-sensitive matching, add a custom column with Combiner.CombineTextByDelimiter or use a case-sensitive comparison in a custom step.
  • Expansion creates too many columns: You can select only the columns you need in the expand dialog. If you accidentally expand everything, undo with Ctrl+Z (or Cmd+Z on Mac) and re-expand.

A common misconception is that merge is the same as append. Append stacks rows vertically (like pasting one table below another), while merge joins columns horizontally. Use Append Queries when you have the same columns in two tables and want to combine the rows.

Merge vs. VLOOKUP vs. XLOOKUP

Power Query merge is not the only way to combine data in Excel. Traditional formulas like VLOOKUP and XLOOKUP work directly in a worksheet without Power Query. Here’s how they compare:

  • VLOOKUP: Simple, but only looks rightward, requires the lookup column to be the first column in the table, and can be slow on large datasets. It also doesn’t handle multiple matches well.
  • XLOOKUP: More flexible—looks left or right, returns arrays, has an if-not-found argument. Still limited to one lookup value and can be slow if used on thousands of rows.
  • Power Query merge: Handles millions of rows efficiently, supports multiple join columns, and refreshes automatically. The downside is that it creates a new query, not a live formula, so you must refresh to update.

If you need a one-time analysis, formulas are fine. If you build a recurring report, Power Query merge is faster and more maintainable.

Performance and Data Size Considerations

Power Query is designed for large data. It can handle millions of rows, but performance depends on your computer’s RAM and the complexity of the merge. To keep things fast:

  • Reduce columns before merging: remove unused columns in each query using Choose Columns.
  • Filter rows early to shrink the data.
  • Avoid expanding the entire table if you only need a few columns.
  • Use Close & Load To > Connection Only if you don’t need the result in a worksheet immediately—you can load later.

If your data is in Excel tables, ensure they are formatted as tables (Ctrl+T) so Power Query can refresh dynamically when new rows are added.

Frequently Asked Questions

Can I merge more than two queries at once?

Power Query merge only joins two queries at a time, but you can merge sequentially: merge the first two, then merge the result with a third query. Alternatively, use the Merge Queries as New option repeatedly. For complex relationships, consider the Power Pivot data model, which allows multiple tables with relationships without merging.

Why does my merge show “null” for some rows?

Nulls appear when a row in the first query has no match in the second query, and you used a Left Outer or Full Outer join. That’s expected. If you don’t want nulls, use an Inner join to keep only matched rows, or filter out nulls after expansion.

How do I merge using multiple columns as the key?

In the Merge dialog, hold down Ctrl (Cmd on Mac) and click each column in the first query, then click the corresponding columns in the second query. Power Query creates a composite key from all selected columns. All columns must match for a row to join.

Can I merge queries from different data sources, like Excel and a SQL database?

Yes. Power Query can connect to many sources—Excel files, CSV, SQL Server, web pages, etc. You create a query from each source, then merge them in the editor. The merge works as long as the key columns have compatible data types.

Does merging change my original data?

No. Power Query merges create a new query output; your source data remains untouched. The original queries are still available in the Queries pane unless you delete them. If you used Merge Queries (not “as New”), the first query is modified, but the underlying source is unchanged.

Is there a way to merge without opening the Power Query Editor?

No, merging requires the Power Query Editor. But you can open it quickly by selecting a table and pressing Alt+F12 (Windows) or going to Data > Launch Power Query Editor. Once you’ve set up the merge, you can refresh the result with Data > Refresh All without reopening the editor.

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.