A null means “no value”: an order not shipped yet, a discount nobody entered, a region missing from the
source. QuickSight has three functions for it: coalesce replaces nulls, isNull and isNotNull test
for them, and nullIf creates them.
Copy and paste
A default value:
coalesce({Region}, 'Unknown')
coalesce({Discount}, 0)
The first value that is not null:
coalesce({Billing Country}, {Shipping Country}, 'Unknown')
Test for null in a condition:
ifelse(isNull({Ship Date}), 'Not shipped', 'Shipped')
Treat empty text as missing too:
coalesce(nullIf({Region}, ''), 'Unknown')
Turn a placeholder into a real null:
nullIf({Delay Reason}, 'unknown')
coalesce
coalesce returns its first argument that is not null and ignores the rest. All arguments must have the
same type, so a date field needs a date default and a number field a number default. If every argument is
null, the result is null.
Empty strings are not null
The AWS reference is explicit: a zero-length string is a valid value. coalesce({Region}, 'Unknown')
leaves '' untouched, and the visual shows a group with no name. nullIf({Region}, '') turns the empty
string into a null first, and coalesce then replaces both cases. Values made only of spaces need
trim as well: nullIf(trim({Region}), '').
Zero is not the same as nothing
Replacing a null measure with 0 changes averages and counts. Take the
seven orders of this section with a
{Discount} column: orders 2, 4 and 6 have a discount of 10, 30 and 20, the other four have none
recorded.
| Measure | Result |
|---|---|
avg({Discount}) |
20.00 |
avg(coalesce({Discount}, 0)) |
8.57 |
count({Discount}) |
3 |
The first answers “how big is a discount when there is one”, the second “how much discount per order”.
Both are legitimate, but they are different questions. Decide which one the report asks before adding
coalesce to a measure. Sums are not affected: adding zeros changes nothing.
Nulls in dimensions
Grouping by a field with nulls gives a separate group for them, often labelled as empty or null.
coalesce({Region}, 'Unknown') gives it a readable name and keeps the rows visible. Filtering the nulls
out instead hides real sales from the totals, so check the row count before you do.
Checked against the Amazon Quick Sight function reference (October 2026). The example results were recomputed in DuckDB.