Power Query cleanup went wrong: rebuild from raw columns

Updated · 2 min read

To undo a damaging bank-CSV cleanup, rebuild from retained raw values and the prior rule version. A cleaned value may not contain enough information to reconstruct its original spacing, signs or description. Power Query’s Applied Steps are useful transformation logic, not an immutable audit snapshot.

Official reference.

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.

Preserve before the destructive step

  1. Retain the source file and its hash outside the refreshable query. Keep stable row identities with that source revision.
  2. Before conversion or text cleanup, duplicate the relevant columns; Microsoft documents the Duplicate Column operation. These retained raw values must precede the destructive step.
  3. Name the rule version and document which derived fields it changes.
  4. Preserve a field-level before/after comparison. Use it to isolate unexpected alterations without discarding legitimate reviewed changes elsewhere.

Power Query’s Duplicate query and Reference query serve different purposes: a reference follows its source query, while a duplicate is a separate copy of the query steps. Neither alone preserves all historical input bytes or produces an immutable audit log. Store the retained source separately from a refreshable query.

Replay rather than invert

The synthetic rollback exercise maps both ACME and ACME to ACME under a trimming rule. The final string cannot reveal which original it came from. Retained raw columns restore both exactly, while the field-difference record identifies only the changed row. A new source hash is treated as a new revision, not quietly substituted into the old audit record.

Synthetic source positionRaw value, shown as a quoted stringResult of trim-v1Changed?
1" ACME ""ACME"Yes
2"ACME""ACME"No

The two input values collapse to one distinct result; only one row actually changes. Restore from its retained raw value, not from the cleaned string.

On a working copy, select the prior approved rule and replay it from the retained source. Compare identities, changed fields and unresolved cases before exporting another CSV. If the raw source is unavailable, keep uncertain values unresolved instead of claiming a lossless inverse.

The reference exercise runs Python logic, not Power Query or a bank importer. For a correct cleanup rule’s type and locale settings, use the existing date/decimal guide; this task concerns provenance and rollback when the rule itself was wrong.

Related task.

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-duplicate · Official reference 2 — pq-ui · Official reference 3 — pq-manage

LocalExtract Team

We build LocalExtract, a desktop bank statement converter. Questions or corrections? Contact · Editorial policy

Continue with a related guide