The request

From Eric Sullivan, Operations Manager
Your goal
The Source step is the orders table for 29–31 December 2025 as imported from SQL Server, with order_date as a full timestamp. Keep only completed orders, keep only order_id, order_date, channel and shipping_fee (in that order), and turn order_date into a date with no time.
- Show exactly
order_idorder_datechannelshipping_feenot done yet - 22 rowsnot done yet
Your query steps
| order_id | customer_id | order_date | status | channel | shipping_fee | coupon_code | |
|---|---|---|---|---|---|---|---|
| 1 | 12947 | 1811 | 2025-12-29 07:07:30 | pending | app | 0 | |
| 2 | 12948 | 1735 | 2025-12-29 07:40:14 | pending | app | 0 | |
| 3 | 12949 | 1990 | 2025-12-29 11:29:26 | pending | web | 6.95 | WELCOME10 |
| 4 | 12950 | 192 | 2025-12-29 12:24:25 | completed | web | 0 | |
| 5 | 12951 | 1057 | 2025-12-29 12:33:38 | pending | web | 0 | |
| 6 | 12952 | 482 | 2025-12-29 12:37:52 | completed | app | 0 | |
| 7 | 12953 | 1699 | 2025-12-29 13:31:47 | completed | app | 0 | |
| 8 | 12954 | 786 | 2025-12-29 13:43:21 | pending | app | 0 | |
| 9 | 12955 | 776 | 2025-12-29 17:51:54 | pending | web | 49 | |
| 10 | 12956 | 273 | 2025-12-29 19:10:20 | completed | web | 0 | |
| 11 | 12957 | 1991 | 2025-12-29 19:28:00 | completed | web | 0 | WELCOME10 |
| 12 | 12958 | 615 | 2025-12-29 20:14:58 | completed | web | 0 | |
| 13 | 12959 | 228 | 2025-12-29 21:15:25 | pending | app | 0 | |
| 14 | 12960 | 1635 | 2025-12-29 23:31:07 | pending | web | 6.95 | |
| 15 | 12961 | 1277 | 2025-12-30 01:08:31 | pending | web | 0 | |
| 16 | 12962 | 1554 | 2025-12-30 08:52:37 | pending | web | 0 | WELCOME10 |
| 17 | 12963 | 1748 | 2025-12-30 10:27:31 | pending | web | 0 | |
| 18 | 12964 | 1100 | 2025-12-30 11:19:15 | pending | app | 0 | FREESHIP |
| 19 | 12965 | 1012 | 2025-12-30 13:18:34 | completed | web | 0 | |
| 20 | 12966 | 1432 | 2025-12-30 14:16:55 | pending | marketplace | 4.99 | |
| 21 | 12967 | 261 | 2025-12-30 15:23:42 | pending | marketplace | 4.99 | |
| 22 | 12968 | 994 | 2025-12-30 15:30:06 | completed | app | 0 | |
| 23 | 12969 | 1478 | 2025-12-30 17:06:57 | completed | web | 0 | |
| 24 | 12970 | 451 | 2025-12-30 18:45:43 | completed | web | 0 | |
| 25 | 12971 | 431 | 2025-12-30 19:19:43 | pending | marketplace | 4.99 | |
| 26 | 12972 | 819 | 2025-12-30 19:19:50 | completed | marketplace | 4.99 | |
| 27 | 12973 | 785 | 2025-12-30 20:09:11 | pending | app | 6.95 | |
| 28 | 12974 | 1032 | 2025-12-30 21:12:04 | pending | web | 0 | |
| 29 | 12975 | 1981 | 2025-12-30 21:12:55 | pending | app | 0 | |
| 30 | 12976 | 1701 | 2025-12-31 05:18:13 | pending | web | 6.95 | |
| 31 | 12977 | 1321 | 2025-12-31 05:29:21 | pending | app | 6.95 | |
| 32 | 12978 | 1537 | 2025-12-31 07:20:15 | completed | app | 0 | |
| 33 | 12979 | 615 | 2025-12-31 07:30:51 | completed | marketplace | 4.99 | |
| 34 | 12980 | 1989 | 2025-12-31 08:12:13 | completed | app | 0 | |
| 35 | 12981 | 1355 | 2025-12-31 08:36:52 | pending | web | 0 | |
| 36 | 12982 | 1248 | 2025-12-31 08:52:31 | pending | web | 6.95 | |
| 37 | 12983 | 862 | 2025-12-31 10:05:49 | completed | app | 0 | |
| 38 | 12984 | 1063 | 2025-12-31 10:52:35 | pending | web | 0 | |
| 39 | 12985 | 978 | 2025-12-31 11:34:21 | pending | web | 0 | |
| 40 | 12986 | 1854 | 2025-12-31 13:20:34 | completed | app | 0 | |
| 41 | 12987 | 1012 | 2025-12-31 13:41:59 | completed | web | 0 | |
| 42 | 12988 | 1344 | 2025-12-31 13:58:30 | pending | web | 0 | |
| 43 | 12989 | 1872 | 2025-12-31 17:15:21 | completed | app | 0 | |
| 44 | 12990 | 1634 | 2025-12-31 18:13:59 | completed | app | 0 | |
| 45 | 12991 | 1721 | 2025-12-31 18:17:06 | pending | web | 6.95 | |
| 46 | 12992 | 782 | 2025-12-31 18:35:50 | pending | app | 0 | |
| 47 | 12993 | 1614 | 2025-12-31 18:40:37 | completed | app | 0 | WELCOME10 |
| 48 | 12994 | 1955 | 2025-12-31 18:46:24 | completed | app | 0 | |
| 49 | 12995 | 1283 | 2025-12-31 19:11:51 | completed | app | 0 | |
| 50 | 12996 | 578 | 2025-12-31 19:21:13 | pending | web | 0 | |
| 51 | 12997 | 651 | 2025-12-31 20:32:59 | pending | marketplace | 4.99 | |
| 52 | 12998 | 491 | 2025-12-31 21:20:47 | pending | web | 6.95 | |
| 53 | 12999 | 1998 | 2025-12-31 21:59:03 | pending | app | 6.95 | WELCOME10 |
| 54 | 13000 | 601 | 2025-12-31 23:23:56 | pending | web | 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 Eric gets, and why
The lesson
The cheapest data is the data you never import. Every column you load is compressed, stored and scanned on every refresh; every row of a cancelled order is one more row someone has to filter out in DAX later.
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 result after each step. Step names and results match Power Query’s.
In Power BI Desktop: Home → Transform data opens the Power Query Editor. Filter with the arrow
on the status header (untick everything but completed), keep columns with Home → Choose
Columns, and change the type with the icon left of the order_date header → Date. Finish
with Home → Close & Apply.
The three steps
Filter rows: status = completed
Choose columns: order_id, order_date, channel, shipping_fee
Change type: order_date to date
The order matters for two reasons. You can’t filter on status after you have removed it. And in
Power Query, steps that can be sent back to the source should come first.
Query folding
When the source is a database, Power Query tries to translate your steps into one query in the
source’s language. This is query folding: the filter becomes a WHERE, Choose columns becomes
the SELECT list, and the type change becomes a CAST. SQL Server does the work, and only the
rows and columns you keep cross the network into Power BI.
Folding stops at the first step the source can’t express (many custom columns, some text functions, merging with an Excel file, adding an index column). Every step after that runs inside Power Query on the whole table it received. So put the steps that fold, above all filters and column choices, at the top, and the ones that don’t at the end.
To check, right-click a step in Applied Steps: if View Native Query is available, that step folds; if it is greyed out, folding stopped at or before it. Newer versions also show folding indicators next to each step.
Why a date and not a timestamp
A timestamp to the second has a different value on nearly every row, and VertiPaq compresses columns by their distinct values. The report needs days, so keep days: about 1,100 values for three years instead of hundreds of thousands. If someone later wants the hour, add an hour column, not the full timestamp.
Do it at the source when you can
Heavy shaping, such as joins of big tables or history going back years, is cheaper in a database view or the data warehouse than in Power Query. Power Query is best for light, foldable trimming. For large fact tables, incremental refresh (right-click the table in Desktop → Incremental refresh) reloads only the recent days on each refresh.
Common mistakes
- Removing columns instead of choosing them. New source columns sneak in later.
- Filtering in the report. A visual filter hides rows; the model still stores them.
- A non-folding step first. Everything after it runs on the full table.
Lantern lit!
Practised: power queryquery foldingfilter rowschoose columnschange typecardinality
- Solved
- No hints
- First run
