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.

Beginner 15 min read

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

AreaWhereWhat it is for
RibbonTopFile, Home, Transform, Add Column, View, Help
Queries paneLeft (collapsible)All queries in the workbook, grouped in folders if you like
Formula barAbove the previewThe M code of the selected step
Data previewCentreThe result of the selected step, usually the first 1,000 rows
Query SettingsRightQuery 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 date on 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 date and Year.

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.
Tip. Rename steps with meaningful names, such as Removed cancelled orders instead of Filtered Rows1. Your future self, and colleagues opening the query, will understand the recipe at a glance.
Watch out. If you select an earlier step and click a command, Power Query asks whether to insert a new step. Inserting in the middle is allowed, but later steps may refer to columns that no longer exist, giving errors such as The column 'Amount' of the table wasn't found. Check the last step after inserting.

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:

Power Query M
= Table.SelectRows(#"Changed Type", each ([Status] <> "Cancelled"))
Table.SelectRows keeps the rows for which the condition is true; #"Changed Type" is the previous step.

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).

IconTypeExample
ABCTextCustomer names, product codes like 00123
123Whole NumberQuantity 12
1.2Decimal NumberUnit price 4.75
$Fixed Decimal Number (Currency)Money with four decimal places
%PercentageDiscount 0.15 shown as 15%
CalendarDate, Date/Time, Date/Time/Timezone2026-03-31
ClockTime, Duration08:30, 2 days 04:00
Check/crossTrue/FalseActive = TRUE
ABC 123AnyNo 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.

ABCDE
1Emp IDNameHiredSalaryBonus %
2ABC 123ABC 123ABC 123ABC 123ABC 123
300417Maria Lopez2019-04-01485000.05
400852Tom Becker2022-11-15412000.03
501033Aiko Tanaka2025-02-03528000.07

Before: an HR list where every column has type Any (shown in row 2 as the header icon). Everything is effectively text.

ABCDE
1Emp IDNameHiredSalaryBonus %
2TextTextDateWhole NumberPercentage
300417Maria Lopez2019-04-01485005%
400852Tom Becker2022-11-15412003%
501033Aiko Tanaka2025-02-03528007%

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.
Watch out. By default the profiles are based on the top 1,000 rows only. The status bar at the bottom says so. Click that text and choose Column profiling based on entire data set before trusting the numbers on a large table.

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.
Note. On the Mac and in Excel for the web the editor has the same structure. A few panes and options, such as some View tab checkboxes, may be missing or arranged differently, but Applied Steps, the formula bar and the data type icons work the same way.

Check yourself

1. You want both the original Order date and a new Year column. Which tab do you use?

2. Why should Emp ID 00417 be typed as Text?

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?

4. What does the gear icon next to a step mean?

5. Dates in a source look like 04/03/2026 and mean 4 March. How should you convert them?