8. Adding Columns: Power Query Add Column Tab and DAX Calculated Columns
8.5 Conditional Column
If–then–else rules without code. Covered with a data-quality example in Module 7.16. Here is a business example, Basket Size:
Steps in Power BI
- Add Column › Conditional Column › New column name:
Basket Size. - If Amount is less than
199→Small. - Add Clause: Else If Amount is less than
499→Medium. - Else →
Large› OK. - The Operator list changes by type (text: begins with, contains, equals; numbers: is greater than …). The Value/Output boxes can also refer to a column or a parameter (click the ABC123 drop-down).
Aata pudhe jaauya Index Column kade.
Ravindra Bagale's Tip
Mitrano, lakshat theva: rules are checked top to bottom, and the first match wins. Writing "< 499 → Medium" before "< 199 → Small" makes every small basket Medium. Order the rules from the smallest threshold upward and test boundary values like 199 and 200. Ha niyam lakshat theva.