Medium severitydata quality
Power BI Refresh Error:
Test Failure: accepted_values
What does this error mean?
A dbt accepted_values test found rows where a column contains a value not in the defined accepted list. The test is designed to catch categorical columns receiving unexpected values.
Common causes
- 1A new category was added to the source system but the accepted_values list was not updated in dbt
- 2A source system change renamed an existing category
- 3NULL values in the column when NULL is not included in the accepted_values list
- 4Trailing spaces or case differences in the column values (e.g., 'Active ' vs 'Active')
- 5Test data from development/staging containing values not in the production accepted list
How to fix it
- 1Run the failing test with dbt test --select <model> to see the actual failing values
- 2Identify the unexpected values: SELECT DISTINCT <column>, COUNT(*) FROM <model> GROUP BY 1
- 3If the new values are legitimate, update the accepted_values list in schema.yml
- 4If the values are data quality issues, fix the source data or add a transformation to map them
- 5Add quote: true to the test if the comparison should be case-insensitive