Power QueryExercises

Review a Power Query query before you share it

Checklist · By Tahir Nas · Examples run in our simulator · Published · Updated

Jump to the practice task

Readable

  • Steps have names that say what they do: Completed only, not Filtered Rows 3.
  • Non-obvious decisions have a comment: Refunds are negative sales (agreed with Finance, Oct 2026).
  • Long queries are split into staging and output queries.
  • Unused steps and abandoned queries are deleted.

Correct

  • There's at least one check: control total, row count or unmatched keys.
  • Merges have been checked for duplicate keys.
  • The output has the grain the user expects (one row per what?).

Safe

  • No passwords, tokens or API keys anywhere in the M (hosts store credentials separately).
  • No columns of personal data the recipient doesn't need: remove them with Choose Columns, so new personal fields can't leak in later.
  • Privacy levels are set correctly rather than ignored.

Runnable

  • Paths and dates are parameters, not literals scattered through steps.
  • It refreshes on another machine (or in the service) without your personal drive letters.
  • Only output queries load; staging queries are connection-only.

A two-minute self-check query

Add a query that describes the output: columns, types and row count. It doubles as documentation for whoever receives the file:

let
    Output = Table.TransformColumnTypes(#table({"Region", "Month", "Sales"}, {{"North", "2026-10-01", "25.5"}, {"South", "2026-10-01", "39"}}), {{"Month", type date}, {"Sales", type number}}),
    Schema = Table.SelectColumns(Table.Schema(Output), {"Name", "Kind"}),
    WithRows = Table.AddColumn(Schema, "Rows", each Table.RowCount(Output), Int64.Type)
in
    WithRows

Result

NameKindRows
Regionany2
Monthdate2
Salesnumber2

Output produced by the Power Query Exercises simulator, an independent implementation of a documented subset of M.

Region shows up as any: the review just found a missing type.

If several people maintain queries, agree a short naming convention (for example stg for staging queries and plain names for outputs) and a rule that every output has at least one check. Conventions matter less than consistency.

Practise it in the simulator

Each task opens the exact exercise in the browser workspace and is checked against fresh data, not just the example. Free tasks need no account.

Lessons

More resources

Sources

Microsoft's official documentation for the features and functions used on this page.

Power Query Exercises is an independent educational platform and is not affiliated with, endorsed by, sponsored by, or approved by Microsoft Corporation. All third-party trademarks belong to their respective owners.