Power Query Problems

Excel Power Query: Import Folder Files in Date Modified Order

Phi Hung VoPhi Hung Vo Nov 12, 2026 869 views

Question details

The user needs to combine files from a folder in Date modified or Date created order.

Excel Power Query: Import Folder Files in Date Modified Order
Product
Microsoft Excel Power Query
Device & OS
not provided
Scenario
A folder connector query is being used to combine multiple files, and the file sequence must be controlled before or after the Combine Files transformation.
Observed behavior
Power Query may combine files in an unspecified order, or the desired source-file order may be lost during transformation.
Before you start

Confirm that the folder connector returns a Date modified or Date created column for every file and that the files use compatible column structures. Identify whether the required order is oldest-to-newest or newest-to-oldest before editing the query.

Solution 1Recommended

Sort the folder query before using Combine Files

Use this method when the source file date should determine the order of rows in the combined result.

The folder connector exposes file metadata before the binary Content values are combined. Sorting this staging query first lets the Combine Files operation process the files in the required sequence, provided later transformations do not remove or reorder the source information.

1
Open the folder connector query

In Excel, select Data > Get Data > From File > From Folder, choose the folder, and click Transform Data to open the Power Query Editor. If the query already exists, open it from Data > Queries & Connections.

2
Sort the source file date

In the folder query preview, locate Date modified or Date created, select the column, then choose Home > Sort Ascending for oldest-first order or Sort Descending for newest-first order.

3
Select the Content column

Click the Content column, then select Home > Combine Files > Combine & Transform Data. Selecting Content enables the Combine Files command while retaining the sorted file list.

4
Review and load the result

Check the combined preview and applied steps, then choose Home > Close & Load or Close & Load To to return the ordered data to Excel.

Preserve the metadata: Do not remove Date modified, Date created, or the source file name before the files are combined if you may need to verify or restore the order later.
Free Microsoft Office alternative

Use WPS Office as a Lightweight Alternative for Organized Spreadsheet Work

WPS Office is a free, lightweight Microsoft Office alternative with a familiar spreadsheet interface and strong compatibility with Excel XLSX files. While it does not provide Microsoft Excel Power Query, you can migrate compatible workbooks to WPS Spreadsheets for reviewing, sorting, filtering, and maintaining imported data.

Open and edit Microsoft Excel XLSX workbooks with familiar spreadsheet tools.Sort imported records by date, file name, or index using straightforward spreadsheet commands.Enjoy a lightweight interface for reviewing and organizing combined data.Maintain compatibility with Microsoft Office XLSX and XLS spreadsheet formats.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Power Query not combine files in Date modified order automatically?

The folder connector returns file metadata, but the combine process does not guarantee the order you need unless you explicitly sort the staging query. Sort Date modified or Date created before selecting Content and starting Combine Files.

Which Power Query column should I select to combine folder files?

Select the Content column in the folder connector query. This column contains each file's binary data and enables the Home > Combine Files command.

Should I sort Date modified before or after Combine Files?

Sort Date modified before Combine Files when the source file sequence controls the output order. If that order is lost, retain the source date and sort the final query after combining.

How can I handle files with the same modification time?

Apply a secondary sort by file name, Date created, or an index column. This creates a predictable tie-breaker when two files have identical Date modified values.

What happens if the source date column is removed during transformation?

You may no longer be able to verify or restore file order. Return to the folder connector query and keep Date modified, Date created, or the source file name until the final sorting step is complete.