Power Query Problems

Build an Excel Power Query for Daily-Changing Folders and Files

Amos GikundaAmos Gikunda Nov 12, 2026 871 views

Question details

The user needs to create a Power Query that finds and imports the correct daily file when both the folder name and workbook name change.

Product
Microsoft Excel Power Query
Device & OS
not provided
Scenario
A daily folder and file include changing dates and descriptive text, while the query must identify the correct workbook from a parent directory.
Observed behavior
A fixed file path cannot be reused because the folder and file names change each day.
Before you start

Identify the parent directory that contains all daily folders, along with the stable parts of the names, date format, file extension, and any hidden or system files that should be excluded. Confirm that each daily folder and workbook follows enough consistent logic for Power Query to distinguish the required file.

Solution 1Recommended

Connect Power Query to the parent folder and filter the daily workbook

Use this approach when folder and file names change but retain a date, extension, or other predictable text pattern.

A folder query is more reliable than connecting to one fixed workbook path. Power Query can inspect the parent folder, filter rows using dates, extensions, and stable text, then open the matching workbook.

The query needs a minimum level of consistency. If every folder and file uses completely unrelated names, Power Query cannot reliably determine which item belongs to the current day.

1
Open the parent folder connector

In Excel, select Data > Get Data > From File > From Folder, browse to the parent directory containing the daily folders, and select Transform Data instead of loading immediately.

2
Exclude hidden and system files

In Power Query Editor, filter the Attributes column so hidden and system items are removed. You can use the M expression: Table.SelectRows(Source, each ([Attributes]?[Hidden]? <> true) and ([Attributes]?[System]? <> true)).

3
Filter the folder and file names

Use the Folder Path, Name, Extension, and Date modified columns to keep the required date, file extension such as .xlsx, and stable text pattern. For example, use Text.Contains or Text.StartsWith on the Name or Folder Path column.

4
Open the matching workbook

After filtering to the required folder and file, select the Binary value in the Content column or use the Combine Files command, then choose the worksheet or table to import.

5
Refresh the query each day

Select Home > Close & Load to return the result to Excel. On the next day, place the new folder under the same parent directory and select Data > Refresh All.

Keep the naming logic consistent: The date format, file extension, and at least one stable text pattern should remain predictable. If multiple files match the filters, refine the conditions or sort by Date modified before selecting the first row.
Free Microsoft Office alternative

Use WPS Spreadsheet as a Lightweight Alternative for Daily Workbook Tasks

Power Query is an Excel feature, so WPS Office does not directly run or refresh Power Query queries. WPS Spreadsheet provides a free, lightweight alternative for opening, reviewing, editing, and saving the resulting workbooks while preserving familiar spreadsheet workflows and strong Microsoft Office format compatibility.

  1. 1. Open the workbook: Launch WPS Spreadsheet and select Open, then choose the Excel .xlsx or .xls workbook containing the imported daily data.
  2. 2. Review or edit the results: Use the worksheet tabs, filters, formulas, and formatting tools in WPS Spreadsheet to inspect or update the data returned by the external Power Query process.
  3. 3. Save in an Office-compatible format: Select Menu > Save As and choose Excel Workbook (*.xlsx) when the file must be shared with Microsoft Excel users.
Open and edit daily Excel workbooks in a familiar spreadsheet interface.Work with Microsoft Excel .xlsx and .xls files for easier migration and sharing.Use a lightweight, free office suite when Power Query processing is handled separately.Review imported query results and organize daily data without changing the workbook format.
microsoft office alternative - wps office

Frequently Asked Questions

Can Power Query work when both the folder name and file name change every day?

Yes, if the names contain predictable information such as a date, file extension, or stable text. Connect to the parent folder and filter the listing instead of connecting to one fixed file path.

Which Power Query columns should be used to find the daily workbook?

Use Folder Path and Name for folder and file text, Extension for the workbook type, Date modified for recency, and Attributes to exclude hidden or system items.

How can I exclude hidden files from a folder query?

In Power Query Editor, filter the Attributes column, or use Table.SelectRows(Source, each ([Attributes]?[Hidden]? <> true) and ([Attributes]?[System]? <> true)) in the query.

What happens if several files match the Power Query filters?

The query may return multiple rows or select an unintended file. Add more conditions for the date, extension, or stable text, and sort by Date modified when the newest matching file is required.

Can WPS Office create and refresh Microsoft Power Query queries?

No. Power Query is an Excel feature and WPS Office does not directly create or refresh those queries. WPS Spreadsheet can open, edit, and save the resulting .xlsx or .xls workbooks.