Power Fx function
If — Power Fx function reference
Return a value by condition.
Syntax
powerfx
If( Condition1, ThenResult1 [, Condition2, ThenResult2, ... ] [, DefaultResult ] )
Examples
powerfx
If(Score >= 50, "Pass", "Fail")
→ "Pass" / "Fail"
powerfx
If(Score >= 90, "A", Score >= 80, "B", Score >= 70, "C", "F")
powerfx
If(IsBlank(txtEmail.Text), Notify("Email required", NotificationType.Error), SubmitForm(frmSignup))Common mistakes & gotchas
- If supports chained condition/result pairs like if/elseif/else — conditions are checked in order and the first true one wins; later ones never evaluate.
- With no matching condition and no DefaultResult, If returns blank rather than erroring — a common cause of an unexpectedly empty label.
Related Power Fx functions
From Conditional logic