Loading Technical Writing

Power BI

Power Query Basics for Cleaning Messy Excel Data

By Syed Hussnain Sherazi | 2026-05-07 | Power BI | Power Query | Excel | Data Cleaning

A beginner-friendly guide to using Power Query to clean messy Excel files before reporting.

Many Power BI reports begin with Excel files containing merged headers, blank rows, inconsistent dates, comments inside tables, and manually typed categories. Power Query helps turn that into repeatable preparation.

The value of Power Query is repeatability. Instead of cleaning the same file by hand every week, you record a sequence of steps that can run again when the file updates.

The practical context

Best use

Use Power Query for repeatable extraction, cleaning, shaping, and standardisation.

Risk

Bad source structure can still create fragile queries.

Owner

Report authors own transformations and documentation.

Output

A cleaner input table that refreshes with less manual work.

Power Query cleaning path
ImportConnect to the raw Excel file.
ShapeRemove empty rows, promote headers, set types.
StandardiseClean names, dates, categories, and codes.
LoadLoad clean tables into the model.

How to approach it

A useful approach is deliberately simple. Start with the business question, make the data and ownership visible, then add technical detail only where it improves reliability or action.

  • Keep a copy of the original file and avoid editing the raw source manually.
  • Remove blank rows, merged-header problems, and notes above the table.
  • Promote headers and set data types deliberately.
  • Split or merge columns only when it improves the model.
  • Create a clean table output with stable column names.
  • Name queries clearly so the next analyst understands the flow.
InputPower BI
LogicUse Power Query for repeatable extraction, cleaning, shaping, and standardisation.
OutputA cleaner input table that refreshes with less manual work.

Common mistakes

Mistake 1

Cleaning the Excel file manually before every refresh.

Mistake 2

Leaving data types as Any.

Mistake 3

Renaming columns casually when downstream steps depend on them.

Mistake 4

Combining cleaning and business calculations in one messy query.

A simple example

If a weekly sales file has three title rows before the real table, Power Query can remove the top rows, promote headers, set dates, trim text, and load the result every week.

That repeatability is the difference between a personal spreadsheet and a report process.

Checks before you move on

Check

The audience can explain what the output means without the analyst in the room.

Check

The data source, calculation logic, refresh, and access model have owners.

Check

There is a clear path for questions, exceptions, and corrections.

Check

Success is measured by better decisions or less manual effort, not page views alone.

Key takeaway

Power Query is often the first step from manual reporting to professional reporting.

Back to Technical WritingContact Syed Hussnain

Reader Comments

Add a comment with your name and email. Your email is used only for basic validation and is not shown publicly.