The request

From Olivia Bennett, Merchandising Lead
Your goal
Add a calculated column called Price Band to products: "Premium" when products[unit_price] is 100 or more, otherwise "Everyday". The matrix groups the given measures Products and Units Ordered by your column.
- Add the column
Price Bandtoproductsnot done yet - The Total row right toonot done yet
Your calculated column
- Visual
- A matrix: rows = your new column on products, values = [Products], [Units Ordered]
- Measures in the report
Products = COUNTROWS(products)Units Ordered = SUM(order_items[quantity])
Data pane: tables and columns
- order_items order_item_id, order_id, product_id, quantity, unit_price, discount_pct, line_total
- orders order_id, customer_id, order_date, status, channel, shipping_fee, coupon_code
- products product_id, name, category, subcategory, unit_price, unit_cost, launched_on, is_active
- customers customer_id, first_name, last_name, email, city, state, signup_date, segment, referral_source
- returns return_id, order_item_id, returned_on, reason, refund_amount
- Date Date, Year, Quarter, Month Number, Month, Year Month, Year Quarter, Day, Weekday Number, Weekday
Loading the editor…
Reference solution
| product_id | name | category | subcategory | unit_price | unit_cost |
|---|---|---|---|---|---|
| 101 | Vale Velvet Loveseat | Furniture | Sofas | 1,659 | |
| 102 | Alder Oak Coffee Table | Furniture | Tables | 919 | 503.5 |
| 103 | Orchard Rattan Dining Chair | Furniture | Chairs | 789 | 429.87 |
| 104 | Upland Oak Bookcase | Furniture | Storage | 429 | 214.7 |
| 105 | Avery Leather Bed Frame | Furniture | Beds | 449 | 232.7 |
| 106 | Northfield Rattan Sectional | Furniture | Sofas | 229 | 79.35 |
| 107 | Birch Teak Side Table | Furniture | Tables | 169 | 54.61 |
| 108 | Ashford Leather Dining Chair | Furniture | Chairs | 369 | 139.71 |
Mote checks your result
Press Check. Mote fills in your answer and compares it with what the report needs.
What Olivia gets, and why
The lesson
A calculated column adds a new column to a table, filled by a DAX formula that runs once for every row. It is the closest thing in Power BI to filling a formula down a column in Excel.
What you are working in
Power BI Desktop runs only on Windows, so this is a practice report built for this site: the
store’s model, a matrix, and a DAX editor. Your column is added to products, the matrix groups
by it, and the engine checks every cell. It follows Power BI’s rules, so the formula works there
unchanged.
In Power BI Desktop: select the products table in the Data pane, then Table tools → New
column (or Modeling → New column, or right-click the table → New column). Type the formula
in the formula bar and press Enter. The new column appears in Table view filled for every
row, and in the Data pane with a small column icon.
Row context: one row at a time
When a column formula mentions products[unit_price], it means this row’s price. That is
called row context: the formula is evaluated with one current row, then the next, then the
next, 120 times for 120 products.
Price Band = IF(products[unit_price] >= 100, "Premium", "Everyday")
IF takes three arguments: a test that is TRUE or FALSE, the value when it is TRUE, the value
when it is FALSE. Text values go in straight double quotes.
Grouping by the new column
Once the column exists, it behaves like any column the data came with. Put products[Price Band]
on the rows of a matrix and two rows appear, Everyday and Premium. The measures Products
(COUNTROWS(products)) and Units Ordered (SUM(order_items[quantity])) are evaluated per row:
the band filters products, the relationship carries the filter to order_items, and each
measure counts or sums only that band.
When the column is calculated
Calculated columns are computed when the data is loaded or refreshed, and stored in the model like imported columns. They take memory, and they never react to slicers: a product’s band is the same on every page. That is right for a label like this one, which belongs to the product itself.
Common mistakes
- The boundary.
> 100and>= 100differ for every product priced exactly 100. Match the ticket’s words. - Curly quotes.
“Premium”copied from a document is not valid DAX; use"Premium". - No column reference.
IF([unit_price] >= 100, …)works inside the products table, but writingproducts[unit_price]in full makes the formula readable anywhere. - A measure instead. A measure has no current row, so
products[unit_price]on its own has no single value there. Labels per row are columns.
Lantern lit!
Practised: calculated columnifrow contextdax
- Solved
- No hints
- First run
