Power Query course · Lesson 3 of 17
The Power Query Editor: steps, formula bar and data types
Find your way around the Power Query Editor: ribbon tabs, Applied Steps, the formula bar, column profiles, data types and the Advanced Editor.
The Power Query Editor is a separate window that opens on top of Excel. It looks like a small spreadsheet, but it behaves very differently: you cannot click a cell and type into it. Instead you apply operations to whole columns and tables, and each operation becomes a step. Learning the layout of this window, and especially how steps and data types work, prevents most of the problems beginners run into.
Open the editor on any query: double-click the query in Data › Queries & Connections, or right-click it and choose Edit. To open it without a query, choose Data › Get Data › Launch Power Query Editor.
The five areas of the window
| Area | Where | What it is for |
|---|---|---|
| Ribbon | Top | File, Home, Transform, Add Column, View, Help |
| Queries pane | Left (collapsible) | All queries in the workbook, grouped in folders if you like |
| Formula bar | Above the preview | The M code of the selected step |
| Data preview | Centre | The result of the selected step, usually the first 1,000 rows |
| Query Settings | Right | Query name, properties and the Applied Steps list |
If the formula bar is missing, tick View › Formula Bar. If the Query Settings pane is closed, choose View › Query Settings. Both are worth keeping visible at all times.
Transform versus Add Column
Many commands appear on both the Transform tab and the Add Column tab, for example Format, Extract, Date and Rounding. The difference is simple and important:
- Transform changes the selected column in place. Extracting the year from
Order dateon the Transform tab replaces the date with the year. - Add Column keeps the original and adds a new column with the result. Extracting the year on the Add Column tab gives you both
Order dateandYear.
The Home tab collects the most common commands from both, plus everything about loading, combining and managing queries.
Applied Steps
The Applied Steps list is the heart of the editor. Click any step and the preview shows the data as it was after that step. This makes debugging easy: walk down the list until the data looks wrong, and you have found the guilty step.
- A gear icon next to a step means it has a dialog. Click the gear to change its settings, for example the delimiter of a split.
- Right-click a step for Rename, Delete, Delete Until End, Insert Step After, Move Before, Move After and Properties, where you can add a description that appears as a tooltip.
- Drag steps to reorder them, but be careful: a step that refers to a column created later will then fail.
- The × in front of a step deletes it.
Removed cancelled orders instead of Filtered Rows1. Your future self, and colleagues opening the query, will understand the recipe at a glance.The formula bar
Every step is one line of M code, visible in the formula bar. When you remove cancelled orders by unticking Cancelled in the Status filter, the bar shows:
= Table.SelectRows(#"Changed Type", each ([Status] <> "Cancelled"))You can edit the formula directly. Changing "Cancelled" to "Returned" and pressing Enter changes the filter without reopening a dialog. Names containing spaces or special characters are written as #"Name with spaces"; that is why the step names look odd in code. The fx button left of the bar adds a new custom step that simply refers to the previous one, ready for you to edit.
Data types
Each column has a data type, shown by the icon at the left of its header. Types matter because they decide which commands are available (the Date commands only work on dates) and what Excel receives when you load (a number or text that looks like a number).
| Icon | Type | Example |
|---|---|---|
| ABC | Text | Customer names, product codes like 00123 |
| 123 | Whole Number | Quantity 12 |
| 1.2 | Decimal Number | Unit price 4.75 |
| $ | Fixed Decimal Number (Currency) | Money with four decimal places |
| % | Percentage | Discount 0.15 shown as 15% |
| Calendar | Date, Date/Time, Date/Time/Timezone | 2026-03-31 |
| Clock | Time, Duration | 08:30, 2 days 04:00 |
| Check/cross | True/False | Active = TRUE |
| ABC 123 | Any | No type set: risky |
Change a type by clicking the header icon and choosing a new type, or with Transform › Data Type. If the previous step is already a type change, Power Query asks Replace current or Add new step. Choose Replace current unless you really want two type conversions in a row.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Emp ID | Name | Hired | Salary | Bonus % |
| 2 | ABC 123 | ABC 123 | ABC 123 | ABC 123 | ABC 123 |
| 3 | 00417 | Maria Lopez | 2019-04-01 | 48500 | 0.05 |
| 4 | 00852 | Tom Becker | 2022-11-15 | 41200 | 0.03 |
| 5 | 01033 | Aiko Tanaka | 2025-02-03 | 52800 | 0.07 |
Before: an HR list where every column has type Any (shown in row 2 as the header icon). Everything is effectively text.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Emp ID | Name | Hired | Salary | Bonus % |
| 2 | Text | Text | Date | Whole Number | Percentage |
| 3 | 00417 | Maria Lopez | 2019-04-01 | 48500 | 5% |
| 4 | 00852 | Tom Becker | 2022-11-15 | 41200 | 3% |
| 5 | 01033 | Aiko Tanaka | 2025-02-03 | 52800 | 7% |
After: explicit types. Emp ID stays Text so the leading zeros survive; setting it to Whole Number would turn 00417 into 417.
The automatic Changed Type step
When you import a CSV or a sheet, Power Query looks at the first rows and adds a Changed Type step automatically. It is usually right, but it guesses from a sample, so it can be wrong: codes with leading zeros become numbers, a column that is empty in the first 200 rows becomes text, and dates in another country's format become errors. Always click this step and check the icons. You can switch the behaviour off for new queries in File › Options and settings › Query Options › Global › Data Load › Type Detection.
Using Locale
Dates and numbers are written differently around the world. 04/03/2026 is 3 April in the US and 4 March in most of Europe; 1.250,00 is one thousand two hundred fifty in Germany. Right-click the header and choose Change Type › Using Locale…, then pick the data type and the locale the source uses, such as English (United Kingdom) for day/month/year dates. The result is independent of your own computer's settings, so the query works the same for everyone.
Errors and nulls
When a value cannot be converted, the cell shows Error instead of crashing the whole query. Click the empty part of the cell (not the word) to see the message below the preview, for example We couldn't convert to Number. An empty cell shows null. Both are counted by the column profiling tools.
Column quality, distribution and profile
Tick these three boxes on the View tab:
- Column quality shows a bar under each header with the percentage of Valid, Error and Empty values.
- Column distribution shows a mini histogram with the number of distinct and unique values. A customer ID column with 980 distinct values in 1,000 rows probably has duplicates.
- Column profile shows statistics (count, min, max, average, errors) and a value distribution chart for the selected column.
The Advanced Editor
Home › Advanced Editor shows the whole query as one M script. You will use it a lot from The M language: let, steps, lists, records, tables and each onwards; for now, use it to read and to copy a query. Copying the script into a blank query (Home › New Source › Other Sources › Blank Query, then open the Advanced Editor and paste) is a quick way to duplicate logic into another workbook.
Closing the editor
- Home › Close & Load loads the result with the current or default destination.
- Home › Close & Load › Close & Load To… lets you choose Table, PivotTable Report, PivotChart or Only Create Connection.
- Closing the window with the × asks whether to keep your changes.
- Home › Refresh Preview re-reads the source inside the editor, which is useful after you changed the source file while the editor was open.
Check yourself
1. You want both the original Order date and a new Year column. Which tab do you use?
Add Column keeps the original column; Transform replaces it.
2. Why should Emp ID 00417 be typed as Text?
As a number 00417 becomes 417.
3. The column profile shows no errors, but the status bar says it is based on the top 1,000 rows. What should you do?
Errors may hide in rows beyond the first 1,000.
4. What does the gear icon next to a step mean?
The gear reopens the dialog that created the step.
5. Dates in a source look like 04/03/2026 and mean 4 March. How should you convert them?
Using Locale tells Power Query the date order used by the source.