Menu
CoddyTech

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 icon

Challenge

Easy

Mia 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 =
DateQuantitySize
2024-01-123
2024-01-202
2024-01-244
Fields
  • Sales
    • OrderID
    • Date
    • StoreID
    • ProductID
    • CustomerID
    • Quantity
    • UnitPrice
    • Amount
  • Products
  • Stores
  • Customers
  • Dates
  • Targets

All lessons in Power BI Basics