Introduction to Merging Queries

Last Updated: 01 Sep, 2026

What Is Merge Queries in Power BI?

Merge Queries in Power BI combines columns from two or more tables into a single query by matching rows on a shared key column β€” similar to a SQL JOIN. It is performed inside Power Query Editor and lets you enrich a fact table with lookup data (e.g., adding product names to a sales table) without flattening your data model.

How Does Merge Queries Work in Power BI?

When you merge queries, Power Query matches rows from two tables based on one or more key columns you select. You choose a join kind β€” Inner, Left Outer, Right Outer, Full Outer, Left Anti, or Right Anti β€” which determines which rows are kept or discarded. The result is a new or modified query with an expandable column containing the matched rows from the second table.

  • Select Home β†’ Merge Queries (or Merge Queries as New to keep the originals unchanged).
  • Pick the matching column(s) in both tables.
  • Choose the join kind that fits your scenario.
  • Expand or aggregate the new column to pull in the fields you need.

How to Merge Sheets in Power Query

You can merge sheets from the same or different Excel workbooks inside Power Query. First, load each sheet as a separate query using Get Data β†’ Excel Workbook. Then use Home β†’ Merge Queries, select the key column that both sheets share (e.g., Employee ID, Product Code), and choose a join kind. This works identically whether your source is Power BI Desktop or Excel’s own Power Query.

How to Merge Tables in Power Query

Merging tables follows the same steps as merging sheets β€” every data source loaded into Power Query is simply a ‘query’ (table). The key requirement is a shared column with matching values. If the column names differ between tables, that is fine β€” Power Query matches on values, not names. After selecting the join columns and kind, expand the resulting nested table to bring specific columns into your output.

Power Query Merge Columns β€” Concatenating Text Columns

‘Merge Columns’ is a different feature from ‘Merge Queries.’ It concatenates two or more text columns within the same table into a single column, using a separator you specify (e.g., space, comma, dash). Select the columns, right-click β†’ Merge Columns, and choose the delimiter. The original columns are replaced by default β€” duplicate them first if you need to keep them.

Merge Queries Power BI: Join Kinds Explained

Join Kind Rows Kept Typical Use Case
Left Outer All rows from the first (left) table; matched rows from the second Enrich a fact table with dimension data, keeping all fact rows
Right Outer All rows from the second (right) table; matched rows from the first Less common; same as Left Outer with tables swapped
Full Outer All rows from both tables Reconciliation β€” find what exists in either or both
Inner Only rows that match in both tables Show only records with complete data on both sides
Left Anti Rows from the first table that have NO match in the second Find missing or orphaned records
Right Anti Rows from the second table that have NO match in the first Same as Left Anti with tables swapped

 

Merge Excel Files Power Query β€” Combining Multiple Workbooks

To merge multiple Excel files (e.g., monthly reports in a folder), use Get Data β†’ Folder, point to the directory, then combine and transform. Power Query reads each file’s matching sheet and stacks/merges them. For a key-based merge (not stacking), load each file as a separate query first, then use Merge Queries to join them on a shared key.

Power Query Merge Multiple Sheets in One Workbook

If your sheets live in a single workbook and share a key column, load each sheet as a query (Get Data β†’ Excel Workbook β†’ select multiple sheets). Then merge them pairwise or chain multiple merges. For stacking rows from identically structured sheets (no key-based join), use Append Queries instead β€” see the Appending Queries topic.

Merge Queries Append Queries
Purpose Combine columns from two tables using a key (SQL JOIN) Stack rows from two or more tables (SQL UNION ALL)
Result shape Wider β€” more columns, same or fewer rows Taller β€” more rows, same columns
Requires matching key? Yes β€” one or more shared key columns No β€” just matching column names/types
Analogy VLOOKUP / INDEX-MATCH across tables Copy-paste rows from one sheet below another
When to use Enrich data (e.g., add product names to sales) Combine monthly/regional tables with the same structure

How to Merge Queries in Power BI β€” Step-by-Step Tutorial

This tutorial walks you through merging two tables in Power Query Editor using a Left Outer join, then expanding the result to pull in columns from the second table. You will complete the merge in about 5 steps and under 10 minutes.

Prerequisites

  • Power BI Desktop installed (free download from Microsoft Store).
  • Two tables loaded into Power Query β€” e.g., a Sales table and a Products table sharing a Product ID column.

Steps

Step 1: Open Power Query Editor

In Power BI Desktop, click Home β†’ Transform Data to open Power Query Editor. You should see both queries listed in the Queries pane on the left.

Step 2: Select the primary query

Click on the query you want to add columns to (e.g., Sales). This will be the ‘left’ table in the merge.

Step 3: Start the Merge

Click Home β†’ Merge Queries. In the dialog, the top table is already your selected query. Use the bottom dropdown to pick the second table (e.g., Products).

Step 4: Select matching columns

Click the key column in the top table (e.g., Product ID), then click the same-named column in the bottom table. Both columns highlight in green when selected. Choose ‘Left Outer’ as the join kind so all Sales rows are kept.

Step 5: Expand the merged column

After clicking OK, a new column appears (e.g., ‘Products’). Click the expand icon (double-arrow) in its header, uncheck ‘Use original column name as prefix’ if you prefer clean names, select the columns to bring in (e.g., Product Name, Category), and click OK.