The request

From Kevin Walsh, Head of Customer Service
Your goal
The Source step is the orders table for 1–2 December 2025 as imported from SQL Server. Keep only order_id, customer_id, order_date and status, in that order, and keep only the rows whose status is completed.
- Show exactly
order_idcustomer_idorder_datestatusnot done yet - 45 rowsnot done yet
Your query steps
| order_id | customer_id | order_date | status | channel | shipping_fee | coupon_code | |
|---|---|---|---|---|---|---|---|
| 1 | 12224 | 1846 | 2025-12-01 | completed | app | 6.95 | |
| 2 | 12225 | 1319 | 2025-12-01 | completed | app | 0 | BFCM25 |
| 3 | 12226 | 522 | 2025-12-01 | completed | app | 0 | |
| 4 | 12227 | 384 | 2025-12-01 | completed | app | 0 | BFCM25 |
| 5 | 12229 | 328 | 2025-12-01 | completed | app | 0 | |
| 6 | 12232 | 1032 | 2025-12-01 | completed | app | 0 | BFCM25 |
| 7 | 12234 | 1844 | 2025-12-01 | completed | app | 0 | BFCM25 |
| 8 | 12236 | 371 | 2025-12-01 | completed | app | 6.95 | BFCM25 |
| 9 | 12237 | 1319 | 2025-12-01 | completed | app | 0 | BFCM25 |
| 10 | 12242 | 1859 | 2025-12-01 | completed | app | 0 | |
| 11 | 12243 | 1126 | 2025-12-01 | completed | app | 0 | BFCM25 |
| 12 | 12246 | 1816 | 2025-12-01 | refunded | app | 0 | BFCM25 |
| 13 | 12248 | 1846 | 2025-12-01 | completed | app | 0 | |
| 14 | 12250 | 925 | 2025-12-01 | cancelled | app | 0 | |
| 15 | 12252 | 524 | 2025-12-01 | completed | app | 6.95 | |
| 16 | 12255 | 1813 | 2025-12-01 | completed | app | 0 | BFCM25 |
| 17 | 12256 | 1213 | 2025-12-01 | completed | app | 0 | |
| 18 | 12258 | 1531 | 2025-12-01 | completed | app | 0 | BFCM25 |
| 19 | 12260 | 1461 | 2025-12-01 | completed | app | 0 | BFCM25 |
| 20 | 12261 | 558 | 2025-12-01 | cancelled | app | 0 | BFCM25 |
| 21 | 12262 | 229 | 2025-12-01 | completed | app | 0 | BFCM25 |
| 22 | 12265 | 1043 | 2025-12-01 | completed | app | 0 | BFCM25 |
| 23 | 12266 | 1536 | 2025-12-01 | completed | app | 14.95 | BFCM25 |
| 24 | 12268 | 1556 | 2025-12-01 | completed | app | 0 | BFCM25 |
| 25 | 12269 | 1871 | 2025-12-01 | completed | app | 0 | |
| 26 | 12270 | 1157 | 2025-12-01 | completed | app | 0 | |
| 27 | 12271 | 1468 | 2025-12-01 | cancelled | app | 6.95 | |
| 28 | 12273 | 962 | 2025-12-01 | completed | app | 0 | BFCM25 |
| 29 | 12277 | 1033 | 2025-12-01 | completed | app | 0 | |
| 30 | 12278 | 1438 | 2025-12-01 | completed | app | 0 | |
| 31 | 12281 | 894 | 2025-12-01 | completed | app | 0 | BFCM25 |
| 32 | 12282 | 846 | 2025-12-01 | completed | app | 0 | |
| 33 | 12284 | 469 | 2025-12-01 | completed | app | 49 | |
| 34 | 12286 | 797 | 2025-12-01 | completed | app | 14.95 | |
| 35 | 12287 | 904 | 2025-12-01 | completed | app | 6.95 | |
| 36 | 12290 | 1404 | 2025-12-01 | completed | app | 0 | |
| 37 | 12293 | 893 | 2025-12-02 | completed | app | 0 | HOLIDAY20 |
| 38 | 12295 | 1835 | 2025-12-02 | completed | app | 0 | |
| 39 | 12297 | 476 | 2025-12-02 | completed | app | 0 | HOLIDAY20 |
| 40 | 12299 | 863 | 2025-12-02 | completed | app | 0 | |
| 41 | 12302 | 1847 | 2025-12-02 | completed | app | 6.95 | |
| 42 | 12303 | 64 | 2025-12-02 | completed | app | 6.95 | |
| 43 | 12304 | 1156 | 2025-12-02 | completed | app | 6.95 | |
| 44 | 12307 | 29 | 2025-12-02 | completed | app | 6.95 | |
| 45 | 12308 | 519 | 2025-12-02 | cancelled | app | 0 | |
| 46 | 12309 | 381 | 2025-12-02 | completed | app | 49 | HOLIDAY20 |
| 47 | 12311 | 251 | 2025-12-02 | completed | app | 6.95 | |
| 48 | 12312 | 1828 | 2025-12-02 | completed | app | 0 | |
| 49 | 12313 | 1526 | 2025-12-02 | completed | app | 0 | |
| 50 | 12314 | 1763 | 2025-12-02 | completed | app | 0 |
Loading the editor…
Reference solution
Mote checks your result
Press Check. Mote fills in your answer and compares it with what the report needs.
What Kevin gets, and why
The lesson
The first rule of building a report: bring in only what it needs. Every extra column makes the model bigger and slower, and every cancelled order is one more row someone has to remember to filter out.
Getting the data in Power BI Desktop
For a SQL Server table: Home → Get data → SQL Server, type the server and database, choose
Import, then in the Navigator tick the orders table and press Transform Data (not
Load). That opens the Power Query Editor with the table as its first step, called Source.
For an Excel workbook it is Get data → Excel workbook, then the sheet or table in the
Navigator; for a CSV, Get data → Text/CSV. Transform Data is the habit to build: you look at
the data before it reaches the model.
What you are working in
This page is a practice editor for Power Query’s way of working, not Power Query itself. The Source step holds the imported table; you add steps one per line, and the preview shows the table after each one. The step names and results match Power Query’s.
Keep columns by name
Choose columns: order_id, customer_id, order_date, status
In Power BI: Home → Choose Columns, tick the four columns. Power Query records a step called Removed Other Columns. The M it writes:
Table.SelectColumns(Source, {"order_id", "customer_id", "order_date", "status"})
Choosing by name is safer than removing by name: when the source gains a column next month, your report doesn’t change.
Keep rows by a test
Filter rows: status = completed
In Power BI: click the arrow on the status header and untick everything except completed,
or use Text Filters → Equals. The step is Filtered Rows:
Table.SelectRows(#"Removed Other Columns", each [status] = "completed")
Filter early, at the source
When the source is a database, Power Query can often send these first steps back to SQL Server as a query (it is called query folding), so only the rows and columns you keep travel over the network. Steps that can’t fold, like many custom columns, should come after the ones that can.
Common mistakes
- Loading straight from the Navigator. You skip the look at the data and the clean-up.
- Text case. Power Query compares text case-sensitively:
Completedis notcompleted. - Filtering in the visual instead. A visual filter hides rows; the model still carries them.
Lantern lit!
Practised: power queryget datasql serverchoose columnsfilter rowsapplied steps
- Solved
- No hints
- First run
