pbPassingBI
/
Power Query beginner 10 min

Shaping data in Power Query

Applied steps, the M language underneath, and the transformations you use daily.

What you'll be able to do
  • Work with applied steps and understand what they generate
  • Apply the common transformations correctly
  • Explain why step order matters

Applied steps are code

Every click in the Power Query editor appends a step to the Applied Steps list, and each step is a line of M code. Open Advanced Editor to see the whole query as a let ... in expression.

Steps run top to bottom, each taking the previous result as input. Reordering them changes the outcome — filtering before a join is cheaper than filtering after, and removing columns early speeds everything downstream.

The transformations you actually use

Remove columns — do this first and aggressively. Change type — set it explicitly rather than trusting detection, and do it once, near the start.

Filter rows to drop what you'll never report on. Split column by delimiter or position. Merge queries is a join; Append queries is a union.

Unpivot turns wide data into tall — this is the one that makes messy spreadsheet exports usable, and it's worth learning properly. Select the columns you want to keep, then choose Unpivot Other Columns so newly added columns are handled automatically.

Group by aggregates before load, which can shrink a table dramatically.

Query folding

When your source is a database, Power Query tries to translate steps into a single native query the source executes — that's folding. It's much faster than pulling everything and transforming locally.

Right-click a step and check View Native Query. If it's greyed out, folding has stopped at that step. Common folding breakers: adding an index column, some custom M functions, and merging with a non-foldable source.

Keep foldable steps early and non-foldable ones last, so as much work as possible is pushed to the source.

Parameters and reusable queries

Parameters hold values like a file path or server name so you can switch environments without editing every query.

A query can be set to Enable load = off and used only as a staging step for others — useful for a shared cleanup routine. Reference creates a new query starting from another's output; Duplicate copies the steps independently.

Key points
  • Every applied step is M code; order changes results and performance
  • Remove columns and filter rows as early as possible
  • Query folding pushes work to the source — check View Native Query
Check yourself