Home » DAX » COALESCE DAX Function

COALESCE DAX Function

COALESCE DAX

It’s a logical DAX function that used to returns the first expression that does not evaluate to BLANK. If all expressions evaluate to BLANK, BLANK is returned.

Syntax

COALESCE(<expression>, <expression>…)

Parameters

expression – Any DAX expression that returns a scalar expression.



Example -1:

Add one measure to understand the working of Coalesce DAX-

Coalesce_DAX = COALESCE( BLANK() , "No value")

As you can see in above DAX, first expression value is blank, so it will return second expression value. See the output in below screen shot.

Coalesce DAX Result -1

Coalesce DAX Result -1

Example-2

Add another measure and write below DAX code-

Coalesce_DAX = COALESCE( 12345 , "No value")

Here first expression value is not blank so it will return first expression value, see the below output-

Coalesce DAX Result -2

Coalesce DAX Result -2



Example-3

Add one more measure and write below DAX code-

Coalesce_DAX = COALESCE( BLANK() , BLANK())

Here, as both expression values are blank, the function will consequently return a blank result. Please refer to the output for confirmation.

Coalesce DAX Result -3

Coalesce DAX Result -3

Refer more DAX functions: DAX functions

Hope you enjoyed the post. Your valuable feedback, question, or comments about this post are always welcome or you can leave us message on our Contact form , we will revert to you asap.

Leave a Reply