Power Query for beginners: what it is and where to start
Guide · By Tahir Nas · Examples run in our simulator · Published · Updated
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
SortedResult
| Order | Status | Qty | Price | Value |
|---|---|---|---|---|
| A-3 | Complete | 4 | 8 | 32 |
| A-1 | Complete | 2 | 12.5 | 25 |
Output produced by the Power Query Exercises simulator, an independent implementation of a documented subset of M.
What to learn first
- Importing a CSV correctly (delimiter, headers, types).
- Choosing columns and filtering rows by value.
- Cleaning text: trim, case, replace.
- Appending months and merging lookups.
- Group By for summaries.
- 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.
- beginner~10 minFree
Clean and summarize a sales export
Trim messy region names, keep valid completed orders, remove an exact duplicate and total revenue by region.
- beginner~5 minFree
Keep only completed orders (kite shop)
Filter out cancelled and pending orders so only completed sales remain.
- beginner~5 minFree
Keep only the columns a report needs (kite shop)
Choose OrderID, Customer and Qty so the report stays the same shape even when the export gains new columns.
Related pages
Lessons
Sources
Microsoft's official documentation for the features and functions used on this page.
- What is Power Query? (Concept, Microsoft Learn)
- Query overview in Power BI Desktop (Concept, Microsoft Learn)
- Understanding Power Query M functions (Concept, Microsoft Learn)
- Table.SelectRows (Function reference, Microsoft Learn)
- Table.AddColumn (Function reference, Microsoft Learn)
- Table.Sort (Function reference, Microsoft Learn)
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.