Loading exercise…
Loading exercise…
Exercises are built for a keyboard. Read the task here, then open this page on a laptop to solve it.
Bands with SWITCH(TRUE()). SWITCH(TRUE(), condition1, result1, condition2, result2, …, else) checks the conditions in order and returns the result of the first one that is true. The last argument is the result when none is. Test the highest threshold first, so each later test only sees the values below it.
Size = SWITCH(TRUE(), order_items[quantity] >= 20, "Bulk", order_items[quantity] >= 5, "Medium", "Small")
The pricing team groups the catalogue into three price bands and wants to see how much revenue and how many units each band brings in.
Add the calculated column Price Band to products: "Premium" for a list_price of 25 or more, "Standard" for 15 up to 25, and "Budget" below 15. Use SWITCH(TRUE(), …). The matrix shows Revenue and Units by Price Band.
Matrix
Updates as you typeLoading the Brightline model…
Language
Full plan
Power BI ✓ · Excel and SQL also included
Cancel anytime · 14-day full refund · Secure payment by Stripe