COALESCE

Updated on

COALESCE is a DAX function that returns the first argument that does not evaluate to a blank value, or BLANK if all arguments are blank.

Syntax

COALESCE(
   Value1,
   [ Value2, ... ]
)
Argument Properties Description
Value1 Any value or expression.
Value2 Repeatable Any value or expression.

Return Values

A scalar value coming from one of the expressions or BLANK if all expressions evaluate to BLANK.

Remarks

Input expressions may be of different data types.

Example 1

The following DAX query:

EVALUATE { COALESCE(BLANK(), 10, DATE(2008, 3, 3)) }

Returns 10, which is the first expression that does not evaluate to BLANK.

Example 2

The following DAX expression:

= COALESCE(SUM(FactInternetSales[SalesAmount]), 0)

Returns the sum of all values in the SalesAmount column in the FactInternetSales table, or 0. This can be used to convert BLANK values of total sales to 0.

Other functions related to COALESCE are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/coalesce-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy