Sub topic 1
What Power Query Does and Why It Beats Manual Cleanup
Power Query is Excel’s tool for connecting to data, transforming it, and loading the result into a worksheet or data model. It records each transformation as a repeatable step. When the source changes, you can refresh the query instead of repeating manual edits.
Prerequisites
You should be comfortable with Excel tables, rows, columns, and basic data types such as text, numbers, and dates. You should also know how to open and save Excel workbooks and CSV files.
Importing Data
Open Data > Get Data and choose a source. Common choices include an Excel table, a text or CSV file, and all files in a folder.
| Source | Typical use |
|---|---|
| Excel table | Clean data already stored in the workbook |
| CSV file | Import exported system data |
| Folder | Combine repeated files with the same structure |
For an Excel table, choose From Table/Range. For a CSV file, choose From Text/CSV. Power Query previews the data before you load it. Select Transform Data to open the editor.
let
Source = Excel.CurrentWorkbook(){[Name="SalesRaw"]}[Content],
Typed = Table.TransformColumnTypes(
Source,
{{"Date", type date}, {"Amount", type number}}
)
in
TypedThis M code reads the SalesRaw table and assigns suitable types to two columns. M is Power Query’s formula language.
Power Query Editor and Applied Steps
The editor shows a data preview, transformation commands, and an Applied Steps list. Each command adds a step. Select a step to inspect its result. Use the gear icon to edit a step, drag steps only when their order remains valid, or select X to delete one.
Setting Types, Headers, Rows, and Duplicates
Set types early. Dates, numbers, and text behave differently during filtering, grouping, and calculations. Check the locale when dates such as 03/04/2026 could mean March 4 or April 3.
If the first row contains column names, use Home > Use First Row as Headers. Remove titles or blank rows before promoting headers. Use Remove Rows for unwanted records and Remove Duplicates when repeated rows are not valid records.
> Avoid deleting duplicates without checking the business meaning. Two identical-looking sales may be separate transactions.
Exercise
Why is a recorded step usually better than manually deleting blank rows each time?
Show answer
The step is repeatable and runs again during refresh, so the cleanup stays consistent.