IF in a Column
Part of the Power BI Basics section of Coddy's Power BI journey. Lesson 22 of 28.
IF(test, if true, if false) picks one of two results.
Size = IF(Sales[Quantity] >= 3, "Large", "Small")In a column the test runs on each row. Text goes in double quotes.
A text column can go on an axis: one bar per value.
Challenge
EasyMia calls an order line Large when it has 3 items or more. Add a column Size to Sales: "Large" or "Small".
Try it yourself
Size =| Date | Quantity | Size |
|---|---|---|
| 2024-01-12 | 3 | |
| 2024-01-20 | 2 | |
| 2024-01-24 | 4 |
- Sales
- OrderID
- Date
- StoreID
- ProductID
- CustomerID
- Quantity
- UnitPrice
- Amount
- Products
- Stores
- Customers
- Dates
- Targets