Easy Tech Tuts
Microsoft Excel

How to Combine Multiple Excel Files in Power BI (One Query, All Files) Easily 2026

By Impran M NLast checked against official docs

Pasting together data from a stack of Excel files by hand is slow, and it breaks the moment a new file arrives. Power BI's Folder connector handles this with one query: point it at a folder, pick one file as the example, and Power Query applies the same extraction to every other file and stacks the results.

That example-file mechanism is also why the combine fails. Power Query treats every file exactly like the one you chose, down to the sheet or table name. This guide walks the click path and then explains the "key didn't match any rows in the table" error the recording runs into, which almost always comes from that rule.

Before you start

  • Power BI Desktop installed (the Folder connector described here is the Desktop version)
  • Two or more Excel files with the same columns, stored in one folder, each holding its data on a sheet or table with the same name

01Put files with matching structure in one folder

Gather the workbooks into a single folder. The walkthrough uses a desktop folder holding EmployeeData.xlsx and SalesReport.xlsx.

Microsoft's documentation is explicit about what "matching" means here. Every file must have the same file type and structure, including the same columns.

The data also has to sit on an identically named sheet or table in each workbook, because Power Query will look for that exact name in every file. Two workbooks about different subjects (employees and sales, say) will not stack into a meaningful table even if the combine runs.

Monthly exports of the same report are the textbook case. The connector also reads subfolders. Any file sitting in a subfolder is included and processed the same way, so keep stray workbooks out of the tree or plan to filter them.

02Open the Folder connector

On the Home ribbon, click the Get data arrow. The Common data sources list opens with Excel workbook at the top, but Folder is not on that short list.

Click More at the bottom to open the full Get Data dialog, choose the File category, select Folder, and click Connect. Excel workbook only opens one file at a time, so skip it for this task. Browse to your folder (or paste its path) and click OK.

The Common data sources list under Get data, with Excel workbook highlighted. Folder is reached through More at the bottom.
The Common data sources list under Get data, with Excel workbook highlighted. Folder is reached through More at the bottom.

03Check the file list before you combine

Power BI lists every file it found, with Name, Extension, date columns and Folder Path. Scan it for anything that should not be there: a notes file, a template, a copy in a subfolder.

The buttons along the bottom are Combine, Load, Transform Data and Cancel. If the list is clean, open Combine.

If it contains extras, click Transform Data instead, filter the list on Extension or Folder Path in Power Query Editor, then use Combine files on the Content column. Load on its own imports this file list as a table of metadata, which is not what you want.

The Folder connector's preview, listing each Excel file with its extension, dates and folder path above the Combine, Load and Transform Data buttons.
The Folder connector's preview, listing each Excel file with its extension, dates and folder path above the Combine, Load and Transform Data buttons.

04Pick Combine & Transform Data and choose the example object

Combine opens two choices. Combine & Transform Data merges the files and opens Power Query Editor so you can fix headers and data types before anything reaches the report.

Combine & Load merges and loads straight into the model. Use Transform the first time you build the query.

Either choice opens the Combine files dialog. By default the first file in the list is the example file, and you can switch to another from the Example file drop-down.

Select the sheet or table that holds the data in that example. Whatever you pick here is the name Power Query will request from every other file.

The dialog also offers Skip files with errors, which drops any file that fails instead of failing the whole load. Handy, but it can hide a file you meant to include, so check the row count afterwards.

The Combine menu offering Combine & Transform Data or Combine & Load.
The Combine menu offering Combine & Transform Data or Combine & Load.

05Understand the queries Power Query builds

After the combine, the Queries pane holds more than one query. Power Query creates a Transform Sample File query that performs the extraction on the example file, a function that applies those same steps to any file, and your main folder query that runs the function on each file and expands the results into columns.

The helpers sit in a group named Transform file from, followed by your query's name. To change how every file is processed (promote headers, remove a totals row), edit Transform Sample File.

The function is linked to it, so the change flows to every file. If you rename columns or change types there, check the final step of the main query, because a Changed Type step that references an old column name will error.

06Fix "The key didn't match any rows in the table"

In the recording, clicking Apply changes produces a Load dialog listing the main query, Transform Sample File and Sample File, each with "[Expression.Error] The key didn't match any rows in the table." This error means a navigation step asked for a name that is not there. In a folder combine, that is nearly always the sheet or table picked in the Combine files dialog.

Power Query looks for that exact name in each file, and a workbook whose data sits on a differently named sheet has no matching row. Files built from different templates, such as EmployeeData and SalesReport, are a classic trigger.

To fix it, open each workbook and give the data sheet (or Excel table) the same name everywhere, then refresh. If you cannot control the source files, remove the non-matching workbooks from the folder, or filter them out of the file list in Power Query Editor.

The Load dialog after applying changes, showing the key-didn't-match error on the folder query and both sample-file helper queries.
The Load dialog after applying changes, showing the key-didn't-match error on the folder query and both sample-file helper queries.

07Refresh to pull in new files

The query is tied to the folder, not to individual file names. Drop another workbook with the same structure and sheet name into the folder, click Refresh, and its rows join the combined table without any edits to the query. A new file with a different sheet name will bring the key error straight back, so agree on the template with whoever supplies the files.

When it doesn't work

Apply changes fails with "The key didn't match any rows in the table"

Why: At least one workbook does not contain the sheet or table name chosen in the Combine files dialog. Power Query requests that exact name from every file.

Fix: Rename the data sheet or table so it matches in every workbook, or remove or filter out the files that do not follow the template, then refresh.

The combined table contains rows from files you did not mean to include

Why: The Folder connector reads every file in the folder and its subfolders.

Fix: Rebuild via Transform Data, filter the file list on Extension or Folder Path, then run Combine files on the Content column.

A step-level error appears after editing Transform Sample File

Why: Renaming columns or changing types in the sample query leaves a later Changed Type step in the main query pointing at columns that no longer exist.

Fix: Open the main query, check its last steps, and update or delete the Changed Type step that references the old names.

FAQ

Frequently asked questions

Do all the Excel files need identical column structures?

Yes. Microsoft's documentation says the files must share the same file type and structure, including the same columns. The data also needs to sit on a sheet or table with the same name in every workbook, since Power Query looks for the name you picked from the example file.

Why is Folder missing from the Get data list?

The Common data sources dropdown shows only a short list. Click More to open the full Get Data dialog, and you will find Folder in the File category.

What happens if I add a new Excel file to the folder later?

Refresh the report and the new file's rows are appended, as long as it follows the same structure and sheet name as the example file.

Can I combine files stored in SharePoint or OneDrive instead of a local folder?

Yes. The same combine process works with the SharePoint folder connector, which appears alongside Folder in the File category. Microsoft's combine-files overview lists SharePoint sites and Azure storage as supported sources.

Sources and last check

Screens and click path come from the original screen recording in Power BI Desktop. The Folder connector steps, the Combine files dialog, the helper queries it creates and the same-structure requirement were re-checked against Microsoft Learn documentation in September 2026. That check corrected two points: Folder sits under Get data > More > File (it is not in the Common data sources list), and the key-didn't-match error is now traced to mismatched sheet or table names across files, which the documentation's example-file rule explains.

About the author

Impran M N
Written by

Impran M N

I've been hooked on technology for as long as I can remember — especially the new tools and AI apps that seem to land every other week. Easy Tech Tuts is where I write up whatever I've just worked out: I do the task in the real product, record the screen, and turn it into the guide I wish I'd found first.