Power QueryExercises

Power Query for beginners: what it is and where to start

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

Jump to the practice tasks

What it does

Power Query gets data from files, folders, databases and other sources, cleans and reshapes it, and loads the result into Excel or Power BI. Every action you take is saved as a step. When next month's data arrives, you click Refresh and every step runs again: no copying, pasting or re-cleaning.

Where to find it

  • Excel (Windows, and recent Mac versions): the Data tab → Get Data. Launch Power Query Editor opens the editor. How to open the Power Query editor in Excel shows every route.
  • Power BI Desktop: Home → Get data, or Transform data to open the editor.
  • Online: Power BI dataflows and other Microsoft services use the same editor in a browser.
  • Here: the simulator and M playground run a documented subset of M in your browser, with no install.

How a query looks

Behind the buttons, each query is written in a language called M. You don't need to write it at first, but it helps to recognise it. A beginner-sized query: keep completed orders, add a value column, sort it:

let
    Source = #table({"Order", "Status", "Qty", "Price"}, {{"A-1", "Complete", 2, 12.5}, {"A-2", "Cancelled", 1, 40}, {"A-3", "Complete", 4, 8}}),
    Completed = Table.SelectRows(Source, each [Status] = "Complete"),
    WithValue = Table.AddColumn(Completed, "Value", each [Qty] * [Price], type number),
    Sorted = Table.Sort(WithValue, {{"Value", Order.Descending}})
in
    Sorted

Result

OrderStatusQtyPriceValue
A-3Complete4832
A-1Complete212.525

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

Four steps, each one line. In the editor you'd see them as Source, Completed, WithValue and Sorted in the Applied Steps pane.

What to learn first

  1. Importing a CSV correctly (delimiter, headers, types).
  2. Choosing columns and filtering rows by value.
  3. Cleaning text: trim, case, replace.
  4. Appending months and merging lookups.
  5. Group By for summaries.
  6. Unpivot for month-per-column sheets.

That covers most day-to-day work. Error handling, combining folders, parameters and writing M come next, once the basics feel automatic.

Start practising

Reading helps, but the skill comes from doing. The free exercises below run in the browser with no account: each is checked against data you haven't seen, so you learn to build steps that keep working. Follow the four-week plan if you like structure, or the foundations path.

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.