Power Query Problems

How to Fix Power Query Folder Combine Fails Due to System Files

Emma BrownEmma Brown Nov 11, 2026 869 views

Question details

The user is experiencing failures when attempting to combine files from a folder using Power Query because the folder contains unexpected system or hidden files.

How to Fix Power Query Folder Combine Fails Due to System Files
Product
Microsoft Excel
Device & OS
not provided
Scenario
Combining files from a folder that is synced with SharePoint or OneDrive into a single dataset.
Observed behavior
The Power Query combine operation throws an error and fails to process the dataset due to the inclusion of system or hidden synchronization files.
Before you start

Ensure you know the exact file path of your SharePoint-synced folder and verify the specific file extension (e.g., .xlsx or .csv) of the files you actually want to combine.

Solution 1Recommended

Filter Out System and Hidden Files Using M Code

Modify the Power Query M code in the Advanced Editor to strictly exclude files with system or hidden attributes before combining them.

SharePoint and OneDrive often create hidden system files to manage synchronization. By manually updating the source query, you can instruct Power Query to ignore these problematic files entirely.

1
Open Advanced Editor

In the Power Query Editor, go to the Home tab on the ribbon and click on 'Advanced Editor'.

2
Locate the Source Step

Find the line that defines your folder source, which typically looks like: let Source = Folder.Files("Path_To_Folder").

3
Add the Attribute Filter

Insert a new filtering step right below the Source step: Filtered = Table.SelectRows(Source, each [Attributes]?[System]? <> true and [Attributes]?[Hidden]? <> true).

4
Update the Output Reference

Ensure the 'in' statement or the next transformation step references 'Filtered' instead of 'Source'.

5
Apply and Combine

Click 'Done' to close the Advanced Editor, then proceed with clicking the 'Combine Files' icon on the Content column.

Filter Out System and Hidden Files Using M Code
Code Accuracy: This M code efficiently skips background system files, ensuring your query remains robust even if new hidden files are generated by SharePoint in the future.
Free Microsoft Office alternative

Need a Faster Way to Handle Spreadsheets? Try WPS Office

While debugging Power Query errors in Microsoft Excel can be time-consuming, WPS Office offers a highly compatible, free, and lightweight spreadsheet solution. It provides an intuitive interface and built-in data handling tools that make managing large datasets simple without the heavy system resource overhead.

  1. 1. Download WPS Office: Visit the official WPS website and download the free installation package for your operating system.
  2. 2. Install and Launch: Run the installer and follow the quick setup wizard. Once installed, launch WPS Spreadsheets.
  3. 3. Open Your Excel Files: Simply drag and drop your existing .xlsx or .csv files into the workspace to start analyzing your data immediately.
100% compatible with Microsoft Excel formats (.xlsx, .xls, .csv)Lightweight installation ensures fast loading times even on older devicesFamiliar tabbed user interface makes migration seamless with zero learning curveFree to download with robust data filtering and consolidation features built-in
microsoft office alternative - wps office

Frequently Asked Questions

Why do hidden system files appear in my SharePoint-synced folder?

SharePoint and OneDrive automatically generate hidden system files (such as .DS_Store on Mac or desktop.ini on Windows) to track folder view settings and synchronization statuses. Power Query reads the raw folder contents, which includes these invisible files.

Can I filter out temporary Excel files that start with a tilde (~)?

Yes. When an Excel file is open, a temporary owner file starting with a tilde (~$) is created. You can filter these out in Power Query by clicking the drop-down on the 'Name' column, selecting Text Filters > Does Not Begin With, and entering '~'.

Will filtering by extension fix errors if one of the Excel files is corrupted?

No. Filtering by extension only ensures that Power Query attempts to combine the correct file types. If one of the targeted .xlsx files is corrupted, the combine process will still fail. You will need to identify and remove the corrupted file or add an error-handling step in your query.

Do I need to know M code to resolve this issue?

Not necessarily. While adding the M code snippet in the Advanced Editor is the most comprehensive method, you can easily filter out unwanted files by using the column header drop-downs in the visual interface to exclude specific extensions or uncheck hidden files.