[DAX] COALESCE

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.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store