Power Query’s folder combine is one of the most useful features in Excel. Point it at a folder, and every file becomes one table that refreshes with a click. It works best when every file has the same structure. When the files start to change, so does the refresh: errors, missing columns, or a table that loads without complaint but is quietly wrong.
Table.Combine) instead of the generated expand step, remove or rewrite the automatic Changed Type step, and navigate to sheets by position rather than by name. If the files are stable, fixing the query is the right answer. If they change every month in new ways, a consolidation workflow built for inconsistent files may be simpler.How Combine Files works
When you choose Data › Get Data › From File › From Folder and then Combine & Transform, Power Query creates several queries:
- Sample File: one file from the folder, the first one by default.
- Transform Sample File: the steps you build on that example, such as choosing the sheet, promoting headers and removing rows.
- Transform File: a function generated from those steps and applied to every file.
- The main query: calls the function for each file, then expands the results into one table using the column names of the example file, and usually adds an automatic Changed Type step.
That design is the strength and the weakness. One set of steps applies to every file, which is exactly right when the files share a structure. Microsoft’s own guidance for combining files assumes they do. Anything that differs from the example file is where problems start: this is spreadsheet schema drift meeting a process built on one file’s shape.
Problems, symptoms and fixes
| What changed in a file | Typical symptom | Fix in Power Query |
|---|---|---|
| A heading was renamed (Revenue → Sales) | Expression.Error: The column ‘Revenue’ of the table wasn’t found. Or a new, mostly empty Sales column. | Rename to standard names in the per-file transform, with MissingField.Ignore. |
| A column is missing | The same column-not-found error from Changed Type or a later step. | Remove the automatic type step, or type only columns that every file has; combine with Table.Combine, which fills missing columns with null. |
| A column was added | No error, but the new column is missing from the result. | Replace the generated expand step with one that uses every file’s column names. |
| The sheet has a different name | Expression.Error: The key didn’t match any rows in the table. | Navigate to the first sheet by position, or filter by Kind = “Sheet”. |
| Title rows above the headings | The title becomes a column name; real headings appear as data. | Find the header row by content rather than removing a fixed number of rows. |
| A value has a different type | DataFormat.Error: We couldn’t convert to Number. Or error cells after loading. | Clean the values before typing them; inspect errors with Keep Errors to find the file. |
| Other files in the folder | Errors from temporary ~$ files, PDFs or old copies. |
Filter by extension and exclude names starting with ~$. |
Fix 1: rename columns to standard names before combining
Add a rename step in Transform Sample File so every file is standardised before the results are combined:
Renamed = Table.RenameColumns(Promoted,
{{"Client", "Customer"}, {"Sales", "Revenue"}, {"Territory", "Region"}},
MissingField.Ignore)
MissingField.Ignore means files that don’t contain an old name are left alone. Keep the list as a deliberate record of which headings you have decided are the same field. Be careful with names that look alike but measure different things: Revenue and Net Sales may not be interchangeable.
Fix 2: combine with every file’s columns, not just the example’s
The generated expand step lists the example file’s column names explicitly. Replace the hard-coded list with the union of all files’ columns:
Expanded = Table.ExpandTableColumn(Invoked, "Transform File",
List.Union(List.Transform(Invoked[#"Transform File"], Table.ColumnNames)))
Or skip the expand step and combine the per-file tables directly. Table.Combine lines tables up by column name, keeps every column and fills gaps with null:
Combined = Table.Combine(Invoked[#"Transform File"])
With Table.Combine you lose the file-name column the expand step carried, so add a Source File column inside the per-file transform if you need it.
Fix 3: remove or rewrite the automatic Changed Type step
The Changed Type step Power Query adds after combining names every column it saw in the example file. If any file lacks one of them, the refresh fails. Delete it, then set types yourself only for the columns you know every file has, after renaming.
Fix 4: navigate to the sheet by position
The generated step usually looks like Source{[Item="Sheet1",Kind="Sheet"]}[Data]. If another file calls its sheet “October”, that lookup fails. Taking the first sheet avoids the name:
Sheets = Table.SelectRows(Source, each [Kind] = "Sheet"),
Data = Sheets{0}[Data]
Fix 5: find the header row by content
A fixed Remove Top Rows step only works if every file has exactly the same number of title rows. If they vary, locate the row containing a known heading and skip what is above it. Merging Excel files when the header row is in a different place shows a reusable function.
When fixing the query is the right answer
Stay with Power Query, and invest in making the query robust, when:
- the files come from one system or one template that changes rarely;
- you refresh the same report every week or month;
- you also need to reshape the data: unpivot, join, filter or add calculated columns;
- someone on the team is comfortable maintaining M code.
In that situation a well-built query is hard to beat. It is already in Excel, it refreshes with one click and it documents every step.
When a consolidation workflow may be simpler
The fixes above handle known changes. They are harder to maintain when the changes are new each time: files from many different people or suppliers, templates that drift every month, headings that move, and nobody who wants to own the query. Each new variation means another edit to the rename list, the sheet logic or the header detection, and a failed refresh is often how you find out.
That is the situation ConsoliSheet is designed for. Upload the files as they arrived: it looks for the table in each one, lines columns up by heading rather than position, matches headings that differ only in capitals, spacing, underscores or hyphens, keeps columns that only some files have, shows anything it can’t decide safely, and produces one XLSX with a Source File column. You can then load that clean workbook into Power Query or a PivotTable for the reporting itself. Power Query vs ConsoliSheet compares the two directly.
Common questions
Can Power Query combine files with different headers?
Yes, with extra steps. Rename columns to standard names in the per-file transform, then combine with a column list taken from every file, or with Table.Combine, which keeps every column and fills missing values with null. The default Combine Files setup takes its columns from one example file.
Why does Power Query break when the columns change?
Because the generated steps refer to the example file’s sheet name and column names. When another file renames, removes or moves a column, a step that names it, often the automatic Changed Type step, fails with a column-not-found error, or the column is silently left out.
What does ‘The column of the table wasn’t found’ mean in Power Query?
A step refers to a column by name and one of the files doesn’t have a column with exactly that name, often because it was renamed or removed. Check the step named in the error, usually Changed Type or a rename, and make it tolerant of missing columns.
Why are some columns missing after combining files in Power Query?
The expand step only lists the columns of the example file. Columns that exist only in other files are not expanded. Use a dynamic list of every file’s column names, or Table.Combine.
Power Query keeps breaking because our monthly files change. What should we do?
If the changes are occasional and predictable, make the query tolerant: standard renames with MissingField.Ignore, a dynamic column list, no hard-coded type step, sheets by position and header detection by content. If the files change in new ways each month, standardise the template at the source, or consolidate the files with a tool built for inconsistent spreadsheets and feed the clean result into Power Query.
Files that keep changing shape?
If your spreadsheets don’t arrive in exactly the same shape, try them in ConsoliSheet and see how the columns line up before anything is combined.
Free for up to 5 business columns. No account needed.