Cheat Sheets/Power BI/IF
DAX function

IFDAX function reference

Branch on a condition.

Syntax

dax
IF(<logical_test>, <value_if_true>, [<value_if_false>])

Examples

dax
IF([Sales] > 0, "Yes", "No")
One of two values
dax
IF(SUM(Sales[Amount]) > [Target], "Above target", "Below target")
A status label measure
dax
IF(ISBLANK([Total Sales]), BLANK(), IF([Total Sales] > 100000, "High", "Low"))
Nested IF — SWITCH(TRUE()) is usually cleaner past two levels

Common mistakes & gotchas

Related DAX functions

From Logical & error handling

Used in these tutorials

← Back to the Power BI (DAX) cheat sheet