Combine monthly files with Power Query, using an LLM one step at a time
Point Power Query at a folder of same-shaped files, then use ChatGPT or Copilot only to write or explain individual M steps, testing each one before adding the next.

Tools used
- Power QueryCombines the files and holds every transformation
- Excel (Microsoft 365)Where the combined table lands
- ChatGPTWrites or explains one M step at a time
Step navigator
One refreshable query that stacks every file in a folder, with any extra M steps written and tested one at a time.
Analysts who get the same export every month and paste the files together by hand.
Before you start
An r/excel user who builds Power Query merges with ChatGPT describes a lesson others repeat: break the job into small pieces, because long requests come back wrong or cut off. Microsoft's folder-combine steps do most of the work without any AI. This guide puts the two together.
Step-by-step instructions
Put only same-shaped files in one dedicated folder
Create a folder that holds only the files you want stacked. Microsoft's guidance is to keep them in "a dedicated folder without extraneous files", each with the same column headers, data types and number of columns. Column order doesn't matter because columns are matched by name.

Why this works
Anything else in the folder gets pulled into the query.
Connect with Data → Get Data → From File → From Folder
Select the folder, then choose Transform Data so the Power Query Editor opens with the list of files. Filter the Extension or Folder Path column so only the files you want remain.
Combine Files from the Content column
Select the Content column, then Home → Combine Files. Power Query uses the first file as the example; pick a different sample file from the drop-down if the first one is unusual. Only tick Skip files with errors if you will check which files were skipped.
Why this works
Power Query builds the helper queries for you; no M needed yet.
Ask the LLM for one transformation at a time
For anything the ribbon can't do easily, describe one change and paste the current query from Advanced Editor. The r/excel user who works this way: "it's best to break the project into small pieces" because "the more complicated my instructions are, the less likely ChatGPT 4 is to get them right. Therefore, I break down the project into steps and test each step along the way."
Here is my current Power Query M (pasted below). Add one step after #"Changed Type" that removes rows where [Amount] is null. Return the full query and explain the new step in one sentence.
Why this works
Short asks are easier for the model to get right and for you to check.
Check the new step in Applied Steps before moving on
Paste the result back into Advanced Editor, click the new step in Applied Steps, and check the preview's row count and columns. Another r/excel user who has Copilot define M steps warns: "It makes mistakes, though, so you have to check it and fill the gaps anyway."
Close & Load, then refresh when new files arrive
Select Close & Load. Next month, drop the new file into the same folder and refresh; Microsoft's walkthrough describes setting it up once and then refreshing to see each month's results.
End of guide · Reviewed Oct 26, 2026
Pro tips2
- Keep a copy of the working M in a text file before you paste in an AI edit.
- If one file has an extra column, fix the file rather than adding special-case M.
Common mistakes3
- Pasting a long query and asking for five changes at once.
- Leaving unrelated files in the source folder.
- Ticking Skip files with errors and never checking what was skipped.


