Instant PDF download after payment11 Shelves, 11 books in each, ₹699 a ShelfIndian companies, Indian rupeesWorksheets and Excel templates includedFree Chapter 1 from every ShelfQuestions? support@proshelf.in
0
Home/Blog/How-to
How-to · Excel & Data

Power Query for beginners: clean a messy export once, refresh every month

If you clean the same report every month, Power Query can record the steps for you. Here is how it works.

Clean Data Fast cover
Power Query remembers every cleaning step and replays them on next month's file with one click.
The task

Same mess, every month

The bank statement arrives every month with the same three junk rows, the same text amounts and the same trailing spaces. Fixing it by hand takes twenty minutes, every month, with a chance of missing something. Power Query records the twenty minutes once as a list of steps. Next month: replace the file, press Refresh, done.

Get data → Record steps → Load a clean Table → New file arrives → Refresh

By handPower Query
First month20 minutes30 minutes (you're learning)
Every month after20 minutes, againSeconds
Same steps every time?HopefullyAlways
Can someone else do it?With instructionsPress Refresh All
The method

Open a file in Power Query

  1. Data › From Text/CSV. Choose bank-statement.csv.
  2. Check the preview. File origin should be 65001: Unicode (UTF-8); Delimiter: Comma.
  3. Click Transform Data, not Load. Load would put the messy file straight into a sheet.
  4. The Power Query editor opens. Every change you make from now on is recorded as a step.
Get data from…Menu
A CSV or text fileData › From Text/CSV
An Excel workbookData › Get Data › From File › From Workbook
A Table or range in this fileData › From Table/Range
A whole folder of filesData › Get Data › From File › From Folder (Chapter 7)
A web page tableData › From Web
The method

The editor in one page

The Power Query editor looks busy, but four areas do most of the work.

AreaWhat it's for
Ribbon: Home, Transform, Add Column, ViewThe cleaning commands
Data previewThe table as it looks after the selected step; right-click column headers for most commands
Formula barThe selected step written as a formula (View › Formula Bar)
Query Settings › Applied StepsEvery step, in order: click one to see the data at that point; × deletes it; ⚙ edits it
Query Settings · Applied Steps
i

Source

Removed Top Rows

Promoted Headers

Filtered Rows

▸ Changed Type with Locale

Trimmed Text

Added Amount

The method

Clean the bank statement, step by step

  1. Remove the title rows. Home › Remove Rows › Remove Top Rows: 3.
  2. Use the first row as headers. Home › Use First Row as Headers.
  3. Remove the footer rows. Filter Date to drop blanks and rows that start with text (“Opening Balance”, “** Statement…”).
  4. Set the types with the Indian locale. Next page: dates day first, amounts with lakh commas.
  5. Tidy the narration. Select it › Transform › Format › Trim, then Clean.
  6. Add an Amount column. Add Column › Custom Column: deposit minus withdrawal, treating blanks as 0.
  7. Split the narration (optional). Transform › Split Column › By Delimiter “-”: mode, party, reference.
Custom Column: Amount= (if [Deposit Amt] = null then 0 else [Deposit Amt])
  - (if [Withdrawal Amt] = null then 0 else [Withdrawal Amt])
The method

Types and locale: dates and lakhs done right

Power Query reads everything in a CSV as text until you set types. The locale tells it how the text is written: which order dates are in, and how numbers are grouped.

  1. Select the date columns. Date and Value Date.
  2. Right-click › Change Type › Using Locale. Data type: Date; Locale: English (India).
  3. Select the amount columns. Withdrawal, Deposit, Closing Balance.
  4. Change Type › Using Locale. Data type: Decimal Number; Locale: English (India).
Change Type with Locale
i

Data Type: Date

Locale: English (India)

Sample input values: 31/03/2026

OK Cancel
Text in the fileWithout the right localeWith English (India)
03/04/20264 March or 3 April, depending on the computer3 April 2026
1,25,000.00An error, or text125000
02/13/2026 (month first)An error with India localeUse English (United States) for this source
In three lines

What to remember

  1. Power Query records cleaning steps once and replays them on every refresh.
  2. Always Transform Data; set types yourself with the right locale; filter by rule, not row number.
  3. Load to a Table, never type in it, and refresh with Data › Refresh All.
Query
A recorded set of steps that produces a clean table.
Applied Steps
The list of recorded steps in the editor.
Locale
The country format used to read dates and numbers.

This article is adapted from the book. Examples marked “Example” use invented names and numbers; company stories are based on public sources listed in the book. For general learning; use your own judgement for your situation.