Change an Excel Power Query Source from a File to a Folder
Question details
Change an existing Power Query that imports one Excel file so it can combine multiple Excel files from a folder.

- Product
- Microsoft Excel Power Query
- Device & OS
- not provided
- Scenario
- The user wants to apply an existing query's transformations to multiple Excel workbooks stored in one folder.
- Observed behavior
- The desired result is a combined table that includes data from the folder's workbooks and can be refreshed as files change.
Place the source workbooks in a folder and check that they have consistent sheet or table names and column layouts. Note the existing query's transformation steps so you can reuse the relevant logic.
Create a Folder Query and Reuse Existing Transformations
Use the Folder connector to combine workbooks, then adapt the original query's transformation logic for each file.
File and Folder connectors produce different source steps. Changing a file path in Data Source Settings alone does not convert a file query into a folder query.
In Excel, select Data > Get Data > From File > From Folder. Browse to the folder containing the workbooks and select Open.
In the folder preview, select Combine & Transform Data. Choose a representative sample file and the sheet or table to import, then select OK.
In Power Query Editor, inspect the combined query and the generated Transform Sample File query. Check that the sample produces the expected columns.
Open the original query and review its Applied Steps or Home > Advanced Editor. Recreate or adapt relevant transformation steps in the generated sample-file transformation query, after its source and navigation steps.
Check the combined preview, then select Home > Close & Load. After adding or changing source files, use Data > Refresh All in Excel.

Change the Path of an Existing Folder Source
Use this option if the query already uses the Folder connector and you only need to point it to a different folder.
Work with Excel Files in WPS Spreadsheets
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface for opening and editing Excel files. Its format compatibility helps you move existing workbooks into WPS, although it does not fix or replace Excel's Power Query connector.

Frequently Asked Questions
Can I change a single-file query to a folder query in Data Source Settings?
Data Source Settings can change a source location, but it does not by itself replace the file connector with the Folder connector. Create a new query through Data > Get Data > From File > From Folder instead.
Can I keep the transformations from my original query?
Often, yes. Review the original query's Applied Steps or Home > Advanced Editor, then adapt the relevant transformations in the generated Transform Sample File query. Keep the folder query's generated source and navigation steps.
What happens when I add another workbook to the folder?
Use Data > Refresh All in Excel to refresh the folder query. A new workbook will be included if it passes the query's file filters and has the expected structure.
Why does combining files produce errors?
A workbook may be missing the selected sheet or table, have different columns, or not be a valid source file. Check the folder preview and filter unwanted files, then compare the problem workbook with the sample file.




