The request

From Nicole Turner, Business Accounts Manager
Your goal
The Source step is the account's 34 completed orders from 2025, with order_date as text. Change order_date to a date, add size_band ("Large" when subtotal is 1000 or more, "Medium" when it is 250 or more, otherwise "Small"), and add month with the month's full name (e.g. January).
- Show exactly
order_idorder_datechannelsubtotalsize_bandmonthnot done yet - 34 rowsnot done yet
Your query steps
| order_id | order_date | channel | subtotal | |
|---|---|---|---|---|
| 1 | 8472 | 2025-01-26 | app | 905 |
| 2 | 8553 | 2025-02-04 | app | 157.94 |
| 3 | 8725 | 2025-02-25 | app | 131.93 |
| 4 | 8777 | 2025-03-03 | web | 3927.77 |
| 5 | 8934 | 2025-03-17 | app | 1606.42 |
| 6 | 9081 | 2025-04-01 | web | 1045.37 |
| 7 | 9187 | 2025-04-10 | web | 440.98 |
| 8 | 9428 | 2025-05-03 | marketplace | 2861.92 |
| 9 | 9543 | 2025-05-14 | marketplace | 748.92 |
| 10 | 9622 | 2025-05-20 | app | 1301.93 |
| 11 | 10078 | 2025-06-29 | web | 1577.49 |
| 12 | 10174 | 2025-07-09 | web | 776.82 |
| 13 | 10193 | 2025-07-10 | app | 769.99 |
| 14 | 10221 | 2025-07-13 | app | 498 |
| 15 | 10242 | 2025-07-15 | web | 582.93 |
| 16 | 10551 | 2025-08-12 | web | 10550.87 |
| 17 | 10823 | 2025-09-03 | app | 463.8 |
| 18 | 11049 | 2025-09-25 | marketplace | 1997.98 |
| 19 | 11122 | 2025-09-29 | app | 773.85 |
| 20 | 11257 | 2025-10-11 | web | 889.91 |
| 21 | 11419 | 2025-10-25 | marketplace | 543.9 |
| 22 | 11499 | 2025-10-31 | web | 193.95 |
| 23 | 11798 | 2025-11-15 | app | 525.95 |
| 24 | 11853 | 2025-11-18 | web | 235.89 |
| 25 | 11911 | 2025-11-20 | marketplace | 1132.9 |
| 26 | 11940 | 2025-11-22 | app | 260.92 |
| 27 | 11948 | 2025-11-22 | app | 473.93 |
| 28 | 12027 | 2025-11-26 | web | 70.99 |
| 29 | 12145 | 2025-11-29 | app | 1387.37 |
| 30 | 12400 | 2025-12-06 | app | 200.97 |
| 31 | 12460 | 2025-12-08 | web | 759.97 |
| 32 | 12553 | 2025-12-12 | web | 1757.88 |
| 33 | 12929 | 2025-12-28 | app | 833.83 |
| 34 | 12972 | 2025-12-30 | marketplace | 389.85 |
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 Nicole gets, and why
The lesson
Nicole doesn’t want 34 numbers; she wants three groups and a calendar. That is two new columns, one built from a rule and one taken from the date.
Change the date first
Change type: order_date to date
Date functions need a date. In Power BI, click the ABC icon on the header and pick Date.
If the text is in another format than your locale expects (03/04/2025 from a European system),
use Change Type → Using Locale and pick the source’s locale, so March and April don’t swap.
A conditional column
In Power BI: Add Column → Conditional Column. The dialog builds the rule in rows:
| Column name | Operator | Value | Output | |
|---|---|---|---|---|
| If | subtotal | is greater than or equal to | 1000 | Large |
| Else If | subtotal | is greater than or equal to | 250 | Medium |
| Else | Small |
Name it size_band at the top. Power Query turns the dialog into one M expression, which is
what you write here:
Add column: size_band = if [subtotal] >= 1000 then "Large" else if [subtotal] >= 250 then "Medium" else "Small"
The tests run from the top and stop at the first one that is true, so order matters: put the biggest threshold first. The M step it records:
Table.AddColumn(#"Changed Type", "size_band",
each if [subtotal] >= 1000 then "Large" else if [subtotal] >= 250 then "Medium" else "Small")
When the rule needs more than one column (and, or) or arithmetic, use Add Column → Custom
Column and type the expression yourself. M is case-sensitive: if, then, else are lower
case, and text goes in double quotes.
Parts of a date
Select order_date, then Add Column → Date for a menu of pieces: Year, Month (with
Month, Name of Month, Start of Month and more), Quarter, Week, Day (with
Name of Day), Age. Name of Month records:
Add column: month = Date.MonthName([order_date])
Other useful ones: Date.Year([order_date]), Date.Month([order_date]) (1 to 12, the number
you sort month names by), and Date.Day. Transform → Date offers the same pieces but
replaces the column instead of adding one.
Power Query or DAX?
You could write the band as a DAX calculated column too. A rule that depends only on one row’s values, like this one, is usually better in Power Query: it’s computed once at refresh and compresses well. Keep DAX for logic that depends on filters, such as “Large compared with this customer’s average”.
What it shows
Eleven of the 34 orders are Large, and they bring in about 71% of the account’s money; one August order alone is over $10,500. November is the busiest month, with seven orders.
Common mistakes
- Thresholds in the wrong order. The first true test wins.
- Gaps or overlaps.
> 250in one test and< 250in the next leaves exactly 250 in no band;>=thenelsecovers every value once. - Month names without month numbers. Sorted alphabetically, April comes first. In the model, sort the name by the number (Column tools → Sort by column).
Lantern lit!
Practised: power queryconditional columnif then elsecustom columndate partsmonth namechange type
- Solved
- No hints
- First run
