Medium severitydbt
Power BI Refresh Error:
Test Failure: not_null
What does this error mean?
dbt's not_null test found NULL values in a column expected to always have a value — missing source data, an unmatched JOIN, or a transformation that lost values.
Common causes
- 1A required field in the source system was not populated for some records (e.g., a new optional field with no backfill)
- 2A LEFT JOIN in the model produced NULLs for the right-side columns when there was no match
- 3A COALESCE or CASE expression did not cover all possible input combinations, leaving some rows with NULL output
- 4An incremental model insert path skips a transformation that the full-refresh path applies, leaving NULL in new rows
- 5A source table column was renamed and the model now reads the old column name, which returns NULL for all rows
How to fix it
- 1Query the failing column: `SELECT COUNT(*) FROM <model> WHERE <column> IS NULL` to understand the scope.
- 2Trace the column back through the model SQL to find where NULLs are introduced.
- 3If the source is the origin, add a filter or default value at the staging layer using COALESCE.
- 4Review any LEFT JOINs — if NULLs from unmatched rows are expected, reconsider whether the column should have the not_null test.
- 5If a column was renamed in the source, update the model SQL to use the new column name.
Frequently asked questions
Official documentation: dbt-docs