Power Query bank totals: retain the rows behind each group
Updated · 2 min read
When summarizing bank CSV rows in Power Query, preserve which source events belong to each total. Grouping is not deduplication: two genuine equal-value payments must remain two members even if the summary has one row.
The desktop apps export date, description, and amount as CSV. Open CSV in Excel to save an XLSX workbook. Statement support varies: verify the result against your own PDF.
Define the group’s meaning first
Use a reviewed source with stable event identities and explicit account, currency and date roles. Choose the intended grain, for example account, currency and posting date. Do not group different currencies into a single money total or assume every matching description is the same event.
- Open Group By for the reviewed source and retain the intended account, currency and date keys.
- Add Sum for the amount and Count rows for the member count.
- Add All rows for the underlying records. Inspect that nested detail instead of handing off only the summary.
- Keep the group keys visible and explicitly sort afterward if presentation order matters.
Microsoft’s grouping guide documents these aggregation choices. The Table.Group reference does not guarantee output order.
Prove coverage and membership
The synthetic grouping exercise puts two distinct +25 events and one −10 event in a group: count 3, sum 40, with three retained identities. Removing one +25 as a presumed duplicate incorrectly produces count 2 and sum 15. A separate currency stays in a different group rather than entering the same total.
| Group key: account X, date D | Retained event identities | Count rows | Sum | All rows must retain |
|---|---|---|---|---|
| EUR | A: +25, B: +25, C: −10 | 3 | EUR 40 | A, B and C |
| USD | D: +100 | 1 | USD 100 | D |
The equal EUR payments A and B are distinct stipulated events. Dropping B would leave only two EUR members and EUR 15. The summary must preserve separate currencies and a route back to each underlying identity.
The Python reference checks require every input identity to occur in exactly one group and compare member sums and counts. They do not execute Power Query. In a workbook, inspect expanded group detail before handing off only the summary.
Keep the detailed reviewed dataset and group-key definition alongside the aggregate. Unknown account or currency goes to review rather than an arbitrary catch-all monetary total. Use the separate duplicate-investigation guide when there is actual evidence of repeated source events; reducing row count through grouping does not establish that any transaction was redundant.
For a PDF-only bank source, download LocalExtract. It processes one PDF locally to date,description,amount CSV; it does not access platform accounts or synchronize accounting records.
Official sources and scope
Documentation checked October 16, 2026. Official reference 1 — pq-group · Official reference 2 — pq-tablegroup
LocalExtract Team
We build LocalExtract, a desktop bank statement converter. Questions or corrections? Contact · Editorial policy