1. Lighthouse

Level 5 · Append Q3 under Q2

The request

From Shirley Chen, Buyer

“I'm sizing the planter reorder and want Q2 and Q3 2025 in one table with a total per line. I have sales_q2_2025.xlsx and sales_q3_2025.xlsx, both loaded as queries. Heads up: Q2 came from the old report template, so a column may be named differently.”

Your goal

You are in the Sales_Q2 query. Make its columns match Sales_Q3 (look at both: one column has a different name), append Sales_Q3 under it, then add line_total = quantity × unit_price for every row of the combined table.

  • Show exactly order_id order_date product quantity unit_price line_totalnot done yet
  • 30 rowsnot done yet

Your sheet

Excel
The sheet for this level
order_idorder_dateproductqtyunit_price
191082025-04-03Fern Concrete Raised Garden Bed1662.15
291302025-04-06Fern Concrete Raised Garden Bed3779
391782025-04-09Pacifica Steel Planter1289
492312025-04-14Linen Aluminum Raised Garden Bed1568.65
592332025-04-15Fern Concrete Raised Garden Bed2779
692502025-04-16Linen Aluminum Raised Garden Bed1669
793852025-04-29Driftwood Acacia Planter1219
894182025-05-02Pacifica Steel Planter1289
996222025-05-20Driftwood Acacia Planter3219
1097242025-05-30Linen Aluminum Raised Garden Bed4669
1197492025-06-01Fern Concrete Raised Garden Bed1779
1297712025-06-02Fern Concrete Raised Garden Bed1779
1397862025-06-04Fern Concrete Raised Garden Bed1779
1498232025-06-07Pacifica Steel Planter4289
1599482025-06-19Linen Aluminum Raised Garden Bed1669
16100492025-06-27Linen Aluminum Raised Garden Bed2669

Loading the editor…

    ResultPress Check to compare the query result

    Mote checks your result

    Press Check. Each row of the result that matches becomes a firefly in your lantern.

    The lesson

    Append is copy-and-paste for queries: the rows of one table go under the rows of another. Merge (last level) adds columns from a second table; Append adds rows. You reach for Append when the same report arrives in pieces: one file per month, per quarter, per store.

    Append matches by column name

    Power Query does not stack the first column on the first column. It matches names. Shirley’s two files have the same data in the same order, but the old Q2 template calls the quantity qty:

    Sales_Q2 Sales_Q3
    order_id, order_date, product, qty, unit_price order_id, order_date, product, quantity, unit_price

    Append them as they are and you get six columns: qty filled for the 16 Q2 rows and null for the 14 Q3 rows, and quantity the other way round. No error, no warning; a PivotTable on that table would count only half the units in each column.

    So rename first, in the Q2 query:

    Rename column: qty to quantity
    Append queries: Sales_Q3

    In Excel: double-click the qty header and type quantity. Then Home → Append Queries, choose Two tables, pick Sales_Q3 as the table to append, OK. Append Queries as New does the same but leaves both originals alone and builds a third query, which is tidy when several reports use the quarters separately.

    Add the total after the append

    Add column: line_total = [quantity] * [unit_price]

    Steps run in order, and each one only sees the table above it. A custom column added before the append exists only in the Q2 rows; the Q3 rows arrive without it and show null. Put row-level columns after the append, so one step covers all 30 rows.

    Sanity check after appending: 16 + 14 = 30 rows. The totals are 28 units and 15,424.80 for Q2, 24 units and 10,085.65 for Q3: 52 units and 25,510.45 together.

    The M behind the steps

    #"Renamed Columns" = Table.RenameColumns(Source, {{"qty", "quantity"}}),
    #"Appended Query" = Table.Combine({#"Renamed Columns", Sales_Q3}),
    #"Added Custom" = Table.AddColumn(#"Appended Query", "line_total", each [quantity] * [unit_price])

    Table.Combine takes a list of tables, so appending three quarters is one step: Table.Combine({Q2, Q3, Q4}). For a folder that gets a new file every month, Data → Get Data → From File → From Folder appends every file in it automatically, and Refresh picks up new ones.

    Common mistakes

    • Not comparing headers before appending. qty and quantity, Price and price, a trailing space in a header: all of them split one column into two.
    • Adding row-level columns before the append. The appended rows get null.
    • Appending files with different meanings. Append trusts the names. If one file’s amount includes tax and the other’s doesn’t, the combined column mixes them silently.
    • Appending the same file twice. The row count doubles. Always compare the total rows with the sum of the parts.

    Pick what may run on this site. You can change this any time from "Cookie settings" at the bottom of every page.