High severitydata format
Power BI Refresh Error:
23502
What does this error mean?
An INSERT or UPDATE attempted to store NULL in a column defined as NOT NULL.
Common causes
- 1Source data has missing values for required fields
- 2ETL transformation produces NULL for a column that previously had values
- 3Schema migration added a NOT NULL constraint without providing default values
- 4JOIN producing NULL for non-nullable columns due to unmatched rows
How to fix it
- 1Step 1: Identify the column from the error: `ERROR: null value in column 'X' violates not-null constraint`.
- 2Step 2: Add COALESCE() or a default value in the transformation: `COALESCE(source_col, 'default')`.
- 3Step 3: Audit source data for rows where the required field is missing.
- 4Step 4: If appropriate, alter the column to allow NULLs: `ALTER TABLE t ALTER COLUMN c DROP NOT NULL;`.
Frequently asked questions
Official documentation: https://www.postgresql.org/docs/current/errcodes-appendix.html