Skip to content

If

Description

If returns one value when a condition is true and another value when it is false.

Syntax

If(condition, value_if_true, value_if_false)

Parameters

Parameter Required Type Description
condition Yes Boolean expression Condition to evaluate.
value_if_true Yes Any Value returned when the condition is true.
value_if_false Yes Any Value returned when the condition is false.

Notes

Use this function in calculated fields, metric expressions, or query expressions where the function category is supported.

Example

If(SalesAmount > 1000, "High", "Low")

The expression returns the calculated result according to the current query context.