Append monthly Excel files without changing the source workbooks. Preserve provenance, align reordered or missing columns safely, detect repeated headers and duplicate files, then reconcile row counts and control totals.
I need to append monthly Excel files with Power Query without changing the source workbooks. Each workbook is stored in the same folder and contains an Excel table named Sales with these columns: Date, OrderID, Amount Files and control totals: - Sales_Jan.xlsx: 2 data rows, Amount total 200.00 - Sales_Feb.xlsx: 2 data rows, Amount total 250.00 - Sales_Mar.xlsx: 1 data row, Amount total 150.00 Give me exact Excel Power Query steps to: 1. import every .xlsx file from the folder; 2. read only the Sales table from each workbook; 3. append the rows; 4. retain the original filename in a column named Source File; 5. exclude temporary files whose names begin with ~$; 6. set Date, OrderID, and Amount to appropriate data types; 7. load the combined result to a new table without editing the source files; 8. verify the file count, row count, and Amount control total. State the exact expected final row count and Amount total. Warn me not to use the folder's sample-file transformation in a way that removes the filename before it is propagated to the combined rows.
Test 1 of 3 β approved PASS and preserved as tested.
Help me safely append three Excel tables with Power Query when their column order is inconsistent and one file is missing a column. All workbooks contain a table named Sales: North.xlsx columns: OrderID, Region, Amount, Tax Rows: N-01 | North | 100 | 20 N-02 | North | 50 | 10 South.xlsx columns: Amount, OrderID, Tax, Region Rows: 80 | S-01 | 16 | South West.xlsx columns: Region, Amount, OrderID Rows: West | 70 | W-01 The West file has no Tax column. Design the append by column name, not column position. Give exact Power Query steps or M logic that: 1. produces the canonical columns OrderID, Region, Amount, Tax, Source File; 2. maps reordered columns correctly; 3. creates Tax as null when it is absent instead of shifting another value into it; 4. flags unexpected extra columns for review; 5. preserves every source workbook; 6. verifies row count and control totals. State the exact expected row count, Amount total, Tax total, and the expected Tax value for W-01. Do not invent zero tax when the source value is unknown.
Test 2 of 3 β approved PASS and preserved as tested.
I am combining Excel exports with Power Query, but one export contains a repeated header row inside the data and the folder also contains a duplicate copy of a monthly file. April.xlsx: Date | OrderID | Amount 2026-04-01 | A201 | 100 Date | OrderID | Amount 2026-04-02 | A202 | 150 April_copy.xlsx contains the same valid transactions as April.xlsx. May.xlsx: Date | OrderID | Amount 2026-05-01 | A203 | 200 Give me a safe Power Query workflow that: 1. keeps Source File; 2. identifies and removes only rows that are demonstrably repeated headers, such as Date="Date", OrderID="OrderID", and Amount="Amount"; 3. does not remove legitimate data merely because one field happens to equal a column name; 4. detects that April.xlsx and April_copy.xlsx may duplicate the same business records; 5. reports duplicate OrderID groups before deciding which rows to retain; 6. keeps an audit table of excluded header rows and potential duplicates; 7. calculates row counts and Amount totals before and after each exclusion. Do not silently delete duplicates. Explain what result is safe before business confirmation, and state the expected result only if April_copy.xlsx is confirmed to be an accidental duplicate.
Test 3 of 3 β approved PASS and preserved as tested.
| Source condition | Risk |
|---|---|
| Three monthly Sales tables | 5 data rows across JanβMar; no combined provenance or control check yet. |
| Output | Expected result |
|---|---|
| Combined query | 5 rows Β· Amount 600.00 Β· Source File on every row |
| Source condition | Risk |
|---|---|
| North, South, West schemas | Columns reordered; West has no Tax column. |
| Output | Expected result |
|---|---|
| Canonical schema | 4 rows Β· Amount 300 Β· known Tax 46 Β· W-01 Tax = null |
| Source condition | Risk |
|---|---|
| Repeated header + April copy | Headers can become data and duplicate files can double revenue. |
| Output | Expected result |
|---|---|
| Audited result | After duplicate confirmation: 3 orders Β· Amount 450 Β· exclusions retained |
Confirm file extensions, the Sales table name, expected files, row counts, and control totals before combining.
Use Data β Get Data β From File β From Folder; filter to .xlsx and exclude filenames beginning with ~$.
Keep Source File, select the canonical fields, align names rather than positions, and use null for genuinely missing fields.
Create review queries for unexpected columns, repeated header rows, and duplicate business keys instead of silently deleting them.
Compare file count, row count, Amount and other control totals before and after every exclusion, then load to a new table.