Power Fx function
Switch — Power Fx function reference
Match one value against many.
Syntax
powerfx
Switch( Formula, Match1, Result1 [, Match2, Result2, ... ] [, DefaultResult ] )
Examples
powerfx
Switch(Status, "A", "Active", "I", "Inactive", "Unknown")
→ The matched result
powerfx
Switch(drpPriority.Selected.Value, "Low", Color.Green, "Medium", Color.Orange, "High", Color.Red, Color.Gray)
powerfx
Switch(true, Amount > 1000, "Large", Amount > 100, "Medium", "Small")
Common mistakes & gotchas
- Switch(true, cond1, r1, cond2, r2, ...) is a common idiom for range-style matching, since Switch itself only ever does exact equality against Formula.
- With no matching value and no DefaultResult, Switch returns blank silently — always include a default for user-facing output.
Related Power Fx functions
From Conditional logic