Power Query Problems

Fix Missing or Extra Columns in Excel Power Query Folder Combine

Olivia MillerOlivia Miller Dec 2, 2026 868 views

Question details

Combine workbooks from a folder when some files have missing or extra columns.

Fix Missing or Extra Columns in Excel Power Query Folder Combine
Product
Microsoft Excel Power Query
Device & OS
not provided
Scenario
A folder query consolidates workbooks with different column sets using a generated Transform File function.
Observed behavior
The combine operation errors when a transformation expects a column that is missing from one or more workbooks.
Before you start

Check the source workbooks for differences in header names, sheets, and tables. In Excel, open Data > Queries & Connections and inspect the generated Transform Sample File query to identify the first step that references a missing column.

Solution 1Recommended

Add missing columns in the Transform File query

Use this method when source files cannot all be edited and missing fields should appear as null values.

Add the normalization step after headers are promoted but before any step that selects, renames, changes the type of, or otherwise references a column that may be absent. The generated function applies the transformation to each file.

The example preserves extra columns, but the combined query may expand only the columns listed in its expansion step. Update that step if you also need to include additional columns.

1
Open the sample transformation

In Excel, select Data > Queries & Connections, then open the generated Transform Sample File query in Power Query Editor.

2
Insert a normalization step

Select Home > Advanced Editor. After the header-promotion step and before any optional-column reference, add steps like these within the existing let expression: RequiredColumns = {"Customer", "Amount", "Date"}, Normalized = List.Accumulate(RequiredColumns, #"Promoted Headers", (state, columnName) => if Table.HasColumns(state, columnName) then state else Table.AddColumn(state, columnName, each null)). Replace the example names and #"Promoted Headers" with your actual column names and preceding step.

3
Connect the remaining steps

In Advanced Editor, make the next transformation use Normalized as its input. Adjust any later column selection, renaming, type changes, or reordering so they do not reference other absent columns.

4
Check the combined output

Open the main folder query and inspect its expanded-table step. Edit the column selection if extra fields are needed, then select Home > Close & Load and refresh the query.

Add missing columns in the Transform File query
Check earlier errors: This approach only fixes missing columns after the normalization step. Missing sheets, tables, or columns referenced earlier in the transformation must be handled separately.
Free Microsoft Office alternative

Review source workbook headers with WPS Spreadsheet

WPS Office is a free, lightweight Office alternative with a familiar interface for reviewing and editing workbook headers. Its Excel format support makes it easy to work with existing files, though it does not fix Microsoft Power Query errors.

Review and standardize source workbook headers before consolidationCompatible with Microsoft Excel XLSX and XLS filesFamiliar spreadsheet interface for working with existing filesFree, lightweight Office alternative
microsoft office alternative - wps office

Frequently Asked Questions

Why does Power Query fail when one workbook is missing a column?

A generated transformation may select, rename, or change the type of a column that is absent in that workbook. Open Transform Sample File in Power Query Editor and find the first step that references the missing column.

Will choosing a sample file with every column fix the error?

Not necessarily. The sample helps define the transformation, but each file still passes through it. Standardize the files or add missing columns in the transformation before they are referenced.

What happens to extra columns in source files?

Extra columns may remain in the transformed tables but be omitted from the final output if the main query's expanded-table step lists only specific columns. Edit that step to include the fields you need.

Can missing columns be filled with blank values?

Yes. In the Transform Sample File query, use Table.HasColumns to check for each expected field and Table.AddColumn to add an absent field with null values before later steps reference it.