Power Query Lesson 6: Append and Combine a Folder of Files

📎 This article includes 2 downloadable practice files ↓

⏱ 3 min read

📘 Power Query Beginner Course · Lesson 6 of 10

In this article
  1. Append: stack two or three queries
  2. From Folder: combine everything
  3. Clean once, apply to every file
  4. Keep out the wrong files
  5. Next month
  6. Where beginners go wrong
  7. Practice

Twelve monthly files, or one file per branch, all with the same columns. Copy-pasting them into one sheet is slow and error-prone. Power Query’s From Folder combines every file in a folder, and next month you just drop the new file in and click Refresh.

Append: stack two or three queries

Home › Append Queries › Append Queries as New › choose the tables. Columns are matched by name, not position; a column only in one table fills with nulls for the others. Good for a few fixed sources.

From Folder: combine everything

  1. Unzip the practice file so you have a monthly folder with six CSVs.
  2. Data › Get Data › From File › From Folder › select the folder.
  3. Click Combine › Combine & Transform Data.
  4. Choose the sample file and delimiter; OK.

Power Query creates helper queries (a sample file, a “Transform File” function) and one combined query with a Source.Name column holding each row’s file name. 180 rows from 6 files.

Clean once, apply to every file

To change how each file is read (remove top rows, fix headers), edit the Transform Sample File query, not the combined one. Its steps run on every file.

💡 Keep Source.Name: extract the month from it (Text Between Delimiters ‘sales_’ and ‘.csv’). It’s the audit trail that shows which file every row came from.

Keep out the wrong files

In the combined query’s early steps, filter the Extension column to .csv and the Name column to begin with “sales_”. Otherwise a stray Excel lock file (~$…) or a notes.txt breaks the refresh.

⚠️ Every file must have the same column names. If one month’s export calls it ‘Amt’ instead of ‘Amount’, that column comes through as null for that month. Check totals per file after each refresh.

Next month

Save the October file into the folder, Refresh All, done.

Where beginners go wrong

Problem Fix
Header row repeated in the data Promote headers in the Transform Sample File query
Refresh fails on an open file Close the source files; filter out ~$ temp files
Folder path different on a colleague’s PC Use a SharePoint/OneDrive folder (From SharePoint Folder)

More: combine files from a folder.

Practice

Download the source file(s) and the expected-results workbook below. Build the query in Excel (Data › Get Data), load it to a sheet, and compare your row count and totals with the Checks sheet.

📎 Practice files for this article

  • 🗂️
    pq-monthly-files.zipSix monthly sales CSVs (Apr-Sep 2026) in a folder; unzip first.
    ⬇ ZIP · 4 KB
  • 📗
    Expected resultsWhat your query should produce, with check totals.
    ⬇ XLSX · 6 KB

Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong

Leave a Reply

Your email address will not be published. Required fields are marked *