Skip to content

Automatic translation — the Portuguese version is the reference. View in Portuguese

COALESCE

On this page (10)

1st non-blank value in the list.

FieldValue
CategoryLogic
TypeScalar (operates value by value)
Arity2 or more arguments
Compiles to SQL (calculated column)Yes
VersionFormula engine v3.

Aliases#

Canonical name: COALESCE. Accepted aliases (case-insensitive): primeiro.

Syntax#

code
COALESCE(expr; arg2; …)

All arguments are expressions.

Returns#

The 1st non-blank value in the list (keeps the type).

Null handling#

Skips blanks and returns the 1st non-blank value; all blank returns blank.

Evaluation context#

Scalar — evaluated on the result of the arguments (in calculated columns, it runs row by row).

Differences from DAX#

  • DAX equivalent: COALESCE
  • Compatibility: Compatible with DAX
  • Note: First non-blank value in the list.

Examples#

code
COALESCE(desconto; 0)

Example with values#

Input: 1 / 0 (blank) and fallback 99.

code
COALESCE(1 / 0; 99)  →  99

Expected result: 99

Business example#

Fill a missing discount with 0 instead of leaving it blank.

Common errors#

Typos in a column name, an incompatible type, or an invalid argument become a friendly message (pt-BR) — the engine never silently returns a wrong number.


← Back to the formula index

Related links