[DAX] COALESCE

Vincent Tseng
1 min readAug 24, 2021

--

When using Power BI DAX, often times we encounter a BLANK value, and therefore the result/visual shows “(blank)”, which we don’t like to see. In this case, COALESCE comes in handy with readablility and performance to enhance our DAX function.

Syntax

COALESCE( <Value 1>, <Value 2>, <Value 3>)

  • COALESCE returns the first argument that does not evaluated to BLANK.
  • If all arguments evaluate to BLANK, BLANK is returned.

Scenario

  • COALESCE( <measure>, 0 )
    If your measure shows Blank but you want to see 0 instead of Blank in your visual, COALESE is a good way to do it. That is, it returns the first argument that does not evaluated to BLANK. In this case, 0.
  • COALESCE( <measure>, 0 )
    = IF ( ISBLANK (<measure>), 0, <measure>)

Summary

Using COALESCE improves readability and this is a great reason to use it whenever needed. Moreover, COALESCE function also ends up improving performance.

--

--

Vincent Tseng
Vincent Tseng

No responses yet