32 min read

DAX COALESCE: Return the First Nonblank Value in Power BI

Test DAX COALESCE with blank, zero and empty-string inputs. Compare fallback expressions and expected results before choosing Power BI measure defaults.

DAX COALESCE: Return the First Nonblank Value in Power BI

By jackey.ye · Updated 2026-11-30

DAX COALESCE returns the first expression that does not evaluate to BLANK, and returns BLANK if all arguments are BLANK. Zero and empty strings aren't automatically the same as BLANK.

This guide gives Singapore and US Power BI engineers reproducible DAX Query View tests. Every expected output below is hand-derived from the documented return rule and hasn't been executed.

What Does DAX COALESCE Return, and What Happens When Every Argument Is Blank?

It returns the first expression that does not evaluate to BLANK; if all expressions evaluate to BLANK, it returns BLANK. The COALESCE function reference (last updated 2024-04-25, retrieved 2026-11-30) states this rule directly and gives the syntax COALESCE(<expression>, <expression>[, <expression>]…), where each argument is any DAX expression returning a scalar.

The same reference notes that input expressions may be of different data types, and its Example 1 shows EVALUATE { COALESCE(BLANK(), 10, DATE(2008, 3, 3)) } returning 10 — the first argument that is not BLANK. Example 2, = COALESCE(SUM(FactInternetSales[SalesAmount]), 0), is described as converting BLANK totals to 0.

Scope matters here. The reference defines the return rule and the data-type remark; it does not document evaluation order or short-circuit behavior. Treat anything beyond the return rule as unverified until you test it. The BLANK function reference (last updated 2026-03-12, retrieved 2026-11-30) supplies the surrounding definition: blanks are not equivalent to nulls, and DAX uses blanks for both database nulls and blank Excel cells.

Is Zero Treated as Blank by DAX COALESCE?

No. Zero is a numeric value, not BLANK, so COALESCE stops at a zero argument and returns 0. This follows from the documented return rule rather than from a separate statement about zero: the function returns the first expression that does not evaluate to BLANK, and 0 does not evaluate to BLANK. The BLANK reference reinforces the distinction by noting that blanks are not equivalent to nulls.

Run this in DAX Query View to see the difference in your own model. Expected outputs are hand-derived and unexecuted:

EVALUATE
  ROW(
      "BlankThenZero", COALESCE(BLANK(), 0, 5),
      "ZeroFirst", COALESCE(0, 5)
  )
  

Column

Expected value

Reasoning

BlankThenZero

0

First argument is BLANK, so evaluation moves to 0, which is not BLANK

ZeroFirst

0

0 is the first argument and is not BLANK

This matters for KPI design. A fallback of 0 will mask a genuinely missing measure, so decide deliberately whether a blank KPI should display as zero or remain blank.

How Does DAX COALESCE Treat an Empty String Compared With BLANK?

The DAX COALESCE reference does not state that an empty string is treated as BLANK, so no universal rule should be asserted. Treat this as a diagnostic you run to learn your own model's behavior, not as a fixed answer. The BLANK reference says blanks and empty strings are "not always equivalent, but some operations may treat them as such" — a conditional statement, not a guarantee for COALESCE.

One distinction worth keeping separate: DAX BLANK is not SQL NULL. They're different concepts with different semantics, so don't reason about COALESCE as if it followed SQL NULL handling.

Run this diagnostic query in DAX Query View and read the actual result against the conditional expectations below. The expected values are hand-derived and unexecuted; they depend on model data types and implicit conversion, so your output may differ.

EVALUATE
  ROW(
      "EmptyThenFallback", COALESCE("", "fallback"),
      "BlankThenEmpty", COALESCE(BLANK(), ""),
      "EmptyBlankFallback", COALESCE("", BLANK(), "fallback")
  )
  

Column

Conditional expected value

Reasoning (if the condition holds)

EmptyThenFallback

"" — only if "" is not BLANK

If "" counts as nonblank, it's the first selected expression; otherwise "fallback"

BlankThenEmpty

"" — only if "" is not BLANK

BLANK is skipped either way; the result depends on how "" is treated

EmptyBlankFallback

"" — only if "" is not BLANK

If "" counts as nonblank it's selected; otherwise "fallback"

Caution: text-versus-numeric type coercion can change results. If a fallback mixes a number with text, confirm the returned type in DAX Query View before relying on it.

Does DAX COALESCE Short-Circuit or Lazily Evaluate Later Arguments?

Microsoft Learn's DAX COALESCE reference does not document short-circuit or lazy evaluation, so no universal guarantee should be claimed. Do not design measures that depend on a later argument being skipped.

Two adjacent products are easy to confuse, and neither transfers to DAX. The Power Apps Coalesce documentation (last updated 2025-06-19, retrieved 2026-11-30) does describe ordered evaluation and states that values after the first nonblank, non-empty-string value "aren't evaluated" — but that is Power Apps, a different product. The T-SQL COALESCE documentation (last updated 2026-11-02, retrieved 2026-11-30) warns in the opposite direction: input values "are evaluated multiple times," and a subquery can be evaluated twice. Neither behavior should be assumed for DAX.

Practical guidance: do not rely on side effects or expensive expressions being skipped. Computing an expensive expression once in a VAR and passing the variable into COALESCE can make the intent clearer and avoid repeating an expression you write out, but it does not establish lazy evaluation or guarantee lower cost — COALESCE's evaluation order remains undocumented. Treat VAR as a readability and reuse aid, not as a performance fix.

How Do I Test Multiple Fallback Expressions in DAX Query View?

Build one EVALUATE ROW query per scenario, run it in DAX Query View, and compare the returned value against a hand-derived expectation before the measure reaches a report. The DAX query view documentation (last updated 2026-10-23, retrieved 2026-11-30) covers the editor, the results grid and the measure update workflow.

  1. Open DAX Query View in Power BI Desktop: select the DAX Query View icon on the left side.

  2. Write an EVALUATE ROW query with named output columns so each case is labelled in the results grid.

  3. Include cases for BLANK(), 0, an empty string, and a multi-argument fallback chain such as COALESCE(BLANK(), BLANK(), "third", "fourth").

  4. Record the hand-derived expected output next to each query before running it.

  5. Run the query and compare. Treat any mismatch as a finding about the model or your expectation, not about the function.

  6. Promote the validated expression into a DEFINE MEASURE block and use the CodeLens Update model: Add new measure or Overwrite measure action only after the query result matches.

A multi-argument chain test, with expected output hand-derived and unexecuted:

EVALUATE
  ROW(
      "Chain", COALESCE(BLANK(), BLANK(), "third", "fourth"),
      "AllBlank", COALESCE(BLANK(), BLANK())
  )
  

Column

Expected value

Reasoning

Chain

"third"

First two arguments are BLANK; "third" is the first nonblank expression

AllBlank

BLANK

Every expression evaluates to BLANK

Checkpoint after step 5: the query result matches your recorded expectation, and you can explain why each argument was or was not selected. If it does not match, stop and investigate the model before promoting the measure.

Zero or Blank: Which Should a KPI Show?

Choose based on what the business question means, not on what looks tidier. A zero states "measured, and the result was none"; a blank states "no value to report." Microsoft's ISBLANK reference points to guidance on avoiding converting BLANKs to values in DAX (last updated 2024-04-25, retrieved 2026-11-30) as a design consideration, and its own example returns BLANK rather than zero when a ratio cannot be calculated.

Scenario

COALESCE Result

Recommended KPI Display

Rationale

Missing sales row for a store-day

BLANK (no fallback) or 0 (with 0 fallback)

Blank

No measurement exists; a zero would hide the data gap

Genuine zero sales recorded

0

0

The value was measured and the result was none

Empty text attribute

"" or fallback text

Fallback label or blank

Depends on whether an empty string is meaningful in your model

All-blank fallback chain

BLANK

Blank

No argument supplied a value; do not invent one

Mixed-type fallback

Whichever expression is selected

Match the measure's intended type

A text fallback in a numeric measure can break formatting and downstream math

The choice affects report consumer trust: a zero that should have been blank hides a data gap, while a blank that should have been zero understates a total.

How Do I Validate a Fallback Measure Before It Reaches a Report?

Validate in DAX Query View against hand-derived expectations, then confirm the measure in a table visual using the same filter context the report will use. A bare ROW query runs without slicer or row context, so a measure can behave differently once filters apply.

Common failure modes to check:

  • A fallback that converts a real blank into a misleading zero.

  • A text fallback that changes the measure's data type and breaks formatting or arithmetic.

  • A multi-argument chain whose later arguments never fire because an earlier one is always nonblank.

  • A measure that returns a value in a bare ROW query but BLANK under the report's filter context.

Keep validation sets small. The DAX query view documentation states a maximum of 15 MB of data per query and a maximum of 1,000,000 values per query, so large validation sets need ORDER BY and filtering inside the query itself rather than in the results grid.

Acceptance checklist before the measure ships:

  • Expected output recorded for each test case before running.

  • Query run and result matched the recorded expectation.

  • Filter-context case tested, not just the bare ROW query.

  • Returned data type confirmed as intended.

  • Measure description documented with /// comments so it travels with the measure.

Where Does This Fit in a Wider Semantic Model?

A validated DAX fallback still depends on fresh, well-governed data underneath it. Teams standardizing semantic models across regions often pair measure conventions with a governed lakehouse layer, so the same fallback logic reads consistent data in every report.

That's where a governed layer earns its keep. Singdata's AI Lakehouse is one example of where fresh, consistent semantic context is maintained beneath the BI layer, so a COALESCE measure reads the same governed data no matter which region opens the report. Paired with the Analytics Agent, which turns business questions into verifiable SQL, tables, and charts under shared permissions, it keeps conventions consistent for both people and AI agents. If you're weighing that architecture, the Singdata platform overview describes the layer sitting under Power BI.

Frequently Asked Questions

Does DAX COALESCE return zero when all arguments are blank?

No. Per the Microsoft Learn COALESCE reference, if all expressions evaluate to BLANK, COALESCE returns BLANK — not zero. To display zero, pass 0 as an explicit fallback argument, and only when zero is the correct business meaning.

Is an empty string the same as BLANK in DAX COALESCE?

Not established as a universal rule. The DAX COALESCE reference does not state it, and the BLANK reference says blanks and empty strings are not always equivalent. Test it in DAX Query View against your own model before relying on either behavior.

Can I use COALESCE to replace IF(ISBLANK(...)) patterns?

Often yes for simple first-nonblank selection, because COALESCE expresses the intent directly and accepts multiple fallbacks. It is not a drop-in replacement where the IF pattern encodes different logic per branch, and it does not remove the need to decide whether blank or zero is correct.

Does DAX COALESCE evaluate every argument?

Microsoft Learn's DAX COALESCE reference does not document evaluation order or short-circuiting, so treat any claim that later arguments are skipped as unverified. Do not design measures that depend on an argument not being evaluated.

Why does my COALESCE measure return a different type than expected?

Because COALESCE returns the scalar from whichever argument it selects, and the COALESCE reference notes that input expressions may be of different data types, a text fallback inside a numeric measure can change formatting downstream. Keep fallback arguments type-consistent.

Related Articles