Combine Monthly Files From a Folder and Keep the Source Filename: Easy Power Query Fix, 3 Exports

When you combine monthly files from a folder, keep the source filename on every row so you can trace any figure.

Use Excel Power Query’s From Folder connector to stack monthly exports, and keep the file list’s Name column when you expand the rows from each workbook. Rename it SourceFilename so that, after you combine monthly files, every row shows which file supplied it, even after you sort by month, planner size or print batch.

When you combine monthly files for planner inserts, the combined table is a production register, not the artwork. It can tell you that February’s export calls for 12 double-sided A5 sheets of a particular design. The print template controls where that design lands on the paper and which edge goes into the punch.

Combine monthly files in Power Query

  1. Define what one row represents. For a planner insert workflow, one row can represent one design in one print batch. Use fields such as BatchID, PlannerMonth, InsertSize, TemplateID, PrintSides and SheetsToPrint. Define SheetsToPrint as the number of physical sheets, so a double-sided sheet still counts as one. When you combine monthly files that have the same fields and bring in new rows, append the records rather than merging on an identifier. A merge makes sense later if, for example, TemplateID needs to pick up a punch specification from a separate reference table.

  2. To combine monthly files cleanly, prepare a folder with one approved export per month. Use a naming pattern such as 2027-01 Planner Orders.xlsx and 2027-02 Planner Orders.xlsx. In each workbook, put the data in an Excel table with the same name, such as InsertOrders, and use the same column headers. Keep the combined workbook, superseded exports and print PDFs outside the input folder, or Power Query will combine monthly files you never meant to include. Think of this folder as a list of records to append: if the original February workbook and its replacement are both eligible, both will contribute rows.

  3. Connect to the folder and filter the file list before you combine monthly files. In desktop Excel, choose Data > Get Data > From File > From Folder. Select the folder and choose Transform Data, so the editor opens with one row per file. Filter Extension to .xlsx, exclude names beginning with ~$, and keep only names that match the approved export pattern. If the folder contains subfolders, filter Folder Path to the exact input folder. The connector can list files from subfolders as well, which can bring an archived workbook back into the current register.

  4. Combine the Content column using the right table. On the Content header, select the combine files icon to combine monthly files into one table. Choose a representative sample workbook and select InsertOrders in the object list. Power Query builds helper queries that read the same table from each eligible workbook. Put per-file changes in Transform Sample File. For instance, if a legacy workbook layout has two title lines before its headers, remove those lines per workbook, not from the finished stack. If every workbook already has a named Excel table with headers, don’t promote the first data row to headers again.

  5. Keep the filename in the main query. After you combine monthly files, look for Source.Name, the usual name of the original Name column in Excel’s generated query. Rename it SourceFilename. If it isn’t present, inspect the applied steps between the file list and the expansion, especially any Removed Other Columns step. The expansion needs to receive both the filename and the column of transformed tables. Keep the filename alongside that table column, then expand the table column to repeat the filename on every resulting row. Don’t add a fixed text value in Transform Sample File: that would label every row with the sample workbook’s name.

  6. Set output types and validate the result before loading. Keep SourceFilename, BatchID and TemplateID as text, particularly if identifiers contain leading zeroes. Set PlannerMonth to a date, using the first day of the month if that’s the export convention, and set SheetsToPrint to a whole number. If the exports instead have separate Jan, Feb and Mar quantity columns, unpivot the month columns into rows while keeping the source filename as an identifier. Don’t divide work into print batches until the table has a consistent row structure.

  7. Load the register and create a source control view. Select Close & Load To and load the combined data to an Excel table. Build a PivotTable with SourceFilename in Rows, a count of a required field such as BatchID in Values, and a sum of SheetsToPrint in Values.

    Count BatchID only if it’s filled on every row; otherwise, group in Power Query using Count Rows. Compare the results against totals taken independently from the exports. A higher row count can reveal that a second copy was included; a matching row count with a lower sheet total calls for a quantity check. Use the same source row count and control total checks after each refresh.

Worked example: Three monthly exports to one checked print batch

The following figures are illustrative. The input folder contains three workbooks, each with an InsertOrders table. The January export contains three records, February contains two, and March contains four. Each record requests 12 physical sheets. The production rule is to release one month at a time, even though you combine monthly files for all three into one register.

SourceFilenameExpected rowsExpected physical sheets
2027-01 Planner Orders.xlsx336
2027-02 Planner Orders.xlsx224
2027-03 Planner Orders.xlsx448
Total9108
  1. Load and reconcile the nine rows. Filter the combined table to 2027-02 Planner Orders.xlsx. Two records should remain, with 12 sheets each. Clear the filter and check all three filenames against the control view. A grand total of 108 on its own isn’t enough: an extra January record and a missing March record would cancel out if both called for 12 sheets.

  2. Select the February job by its production fields. Suppose one record is FEB-01, template A5-MONTH, double-sided, and the other is FEB-02, template A5-NOTES, single-sided. Both came from February’s workbook, but they are separate printer jobs. Keep SourceFilename next to BatchID on the batch sheet so that a query about FEB-02 can go straight back to the export. Select by PlannerMonth for the release date rather than assuming the filename month always matches the month printed on the insert.

  3. Proof one sheet from each template before printing the balance. For this job, use A5 stock and print at Actual size or 100%, rather than fitting the artwork to the printable area. On the double-sided proof, check that the reverse reads the right way when the sheet turns on the intended binding edge. If it’s upside down, change the duplex flip setting and run another proof. Punch a proof with the actual A5 mechanism and place it in the binder. Check that the holes miss the artwork and that the calendar opens in the intended order.

  4. Release and assemble the 24 accepted sheets. If a proof passes and can go into the batch, print 11 more sheets of that design. If the proof is marked up or the punch is misaligned, print 12 usable sheets instead. Stack the two designs separately, then collate one calendar sheet and one notes sheet into each of 12 sets. Record spoiled sheets separately from the 24 required sheets so the production count does not appear short when a proof has been discarded.

The next month’s refresh should add records to the register without changing which batches were already printed. Keep the print log in a separate table, keyed by SourceFilename and BatchID if that pair is unique. Don’t type status notes beside a query output and assume they’ll stay aligned when new rows arrive or the output order changes.

Fix problems before they reach the print queue

The filename is missing, ambiguous or blank

If the combined table has data but no filename, return to the main query and check which columns survive immediately before expansion. SourceFilename belongs outside the nested tables, on the file list row. If your process deliberately accepts subfolders and two sites both send 2027-02 Planner Orders.xlsx, retain Folder Path as a separate field. The basename alone won’t identify which copy supplied a row.

A new workbook breaks the refresh

Open the newest workbook and check whether InsertOrders still exists as an Excel table, not just as a worksheet name. Then compare the headers with the sample. A change from SheetsToPrint to Quantity, for instance, can break a type or selection step even though the numbers remain in the workbook. Use the refresh failure checks for renamed or removed columns to find the first failing step and decide whether to repair the export or map both header names.

The refresh completes, but the output is short or doubled

Compare the filtered file list with the expected months, then compare the per-file row counts. A workbook with a header and no data contributes no rows, so its filename won’t appear in the final PivotTable. Keep a separate file inventory if you need to distinguish a missing February export from a February export with zero orders. For unexpected extra rows, look for copies and replacements before removing duplicates. Two identical-looking rows might represent different orders; removing one from the combined table can conceal the actual file selection problem.

The file totals match, but the inserts don’t fit

Check finished dimensions and binding pattern independently. A5 is 148 × 210 mm; US Letter is 8.5 × 11 inches. An 11-disc insert and a ring binder insert can share the same page dimensions and still be incompatible. If artwork is laid out on a larger carrier sheet, print at 100%, trim one proof to the finished dimensions and test it in the binder before cutting the stack.

Match purchased refills to the assembly specification

The batch register can cover stock inserts as well as printed sheets. Keep a purchased refill under its own stock code, rather than rolling it into SheetsToPrint. For a US Letter job, for example, the 11-disc monthly refill and the 7/3-hole monthly refill are separate stock choices. For six-ring work, check the Forvencer A5 monthly refill, the A5 project planning refill and the 2027–2028 monthly inserts for six-ring binders against the binder and the required page layout.

US Letter disc and ring refills

2027–2028 US Letter monthly planner refill for 11 discs

The 2027–2028 11-disc monthly planner refill lists 18 monthly calendars at 8.5 × 11 inches, at $11.99 with a 4.6 rating. Use the disc pattern as the stock identifier if printed notes will sit behind these calendar pages.

2027–2028 US Letter monthly planner refill with 7/3 holes

The 2027–2028 7/3-hole monthly planner refill also lists 18 monthly calendars at 8.5 × 11 inches, at $11.99 with a 4.6 rating. Compare the hole positions with an existing binder page before specifying the punch for any matching sheets.

A5 calendar and project pages, plus a six-ring size check

Forvencer 2027 A5 monthly planner refills with six holes

The Forvencer 2027 A5 monthly planner refills are listed as six-hole inserts at $11.99 with a 4.8 rating. Specify the 2027 date range in the stock record if the register covers jobs for more than one year.

A5 six-hole project planner inserts for goals and deadlines

The A5 six-hole project planner inserts list 100 sheets and 200 printed pages, at $9.99 with a 3.9 rating. If each assembled planner gets two sheets for goals, milestones, tasks and deadlines, enter two physical sheets per set in the stock allocation, not four.

2027–2028 monthly planner inserts for six-ring binders

The 2027–2028 monthly planner inserts for six-ring binders are listed at $5.69 with a 4.8 rating. The supplied listing title does not specify the page dimensions. Verify the finished size and ring spacing before assigning these inserts to an A5 or other six-ring batch.

Release a job only when the source totals agree and one assembled set fits the actual binder. If either check fails, hold that batch by SourceFilename and BatchID so the correction stays tied to the right export and design.

Scroll to Top