Stop 04 · Power Query TransformationsTopics · 1/11

Power Query Editor Basics

Part of the Power BI Roadmap

In short

Analysts often say most of their time goes into cleaning data. The Power Query Editor is where that cleaning happens, with clicks instead of formulas, and every click is remembered.

The Power Query Editor is where you clean and shape data with point-and-click steps before loading it into the model. Each step is recorded and replayed on every refresh.

The jaadu writes on a long recipe card pinned beside a stove while a pot behind it seems to stir itself.

Think of it like this

A recipe card that cooks itself

Imagine writing down each step as you cook: wash rice, soak 20 minutes, boil with two cups of water. Next time, the card cooks the dish by itself with fresh rice. Power Query writes that card as you click, and replays it on every refresh.

Watch it happen

The parts of the editor

Queries pane
Data preview
Formula bar
Applied Steps
Close & Apply

1/5Left: the Queries pane lists every query, like Sales, Products and Targets.

The big ideas

What you need to know

Clicks write code

Each ribbon button adds a step written in M. You rarely need to type code at the start.

Column quality and profile

On the View tab, turn on Column quality and Column distribution to spot errors and blanks quickly.

Preview is a sample

Profiling looks at the top 1,000 rows by default. Switch to Column profiling based on entire data set at the bottom when it matters.

Advanced Editor

Home, Advanced Editor shows the full query as one let ... in script.

See it in code

Walk through the code

m
1let2    Source = Excel.Workbook(File.Contents("D:\Data\sales.xlsx"), null, true),3    Sales = Source{[Item = "tblSales", Kind = "Table"]}[Data],4    #"Removed Columns" = Table.RemoveColumns(Sales, {"Notes"}),5    #"Changed Type" = Table.TransformColumnTypes(6        #"Removed Columns",7        {{"OrderDate", type date}, {"Amount", Currency.Type}}8    ),9    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each [Amount] > 0)10in11    #"Filtered Rows"

1/4Source and navigation: open the workbook and pick the table.

What the Advanced Editor shows after five clicks. Each line is one Applied Step, and each step uses the result of the one before.

Save yourself the pain

Common mistakes

Oops

Cleaning data in Excel by hand each week, then loading it.

Do this instead

Load the raw file and clean it in Power Query, so the same cleaning runs on every refresh.

Oops

Trusting Column quality when it says 100% valid on a big table.

Do this instead

It is based on the top 1,000 rows by default. Switch to the entire data set before concluding there are no errors.

Your mission

Tour the editor

~20 min

Quick check

What does clicking an earlier step in Applied Steps do?

Go deeper

  1. 1Open Transform data and find the ribbon, queries list and Applied Steps.
  2. 2Turn on column quality, distribution and profile in the View tab.
  3. 3Clean one messy table without writing any code.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge