Medium severitysql
Power BI Refresh Error:
ARITHMETIC_OVERFLOW
What does this error mean?
A numeric operation produced a result that exceeds the maximum value for the target data type. The query is aborted to prevent silent data corruption from truncated values.
Common causes
- 1Multiplying two large INTEGER or BIGINT columns whose product exceeds the type's range
- 2Casting a DOUBLE or DECIMAL with a large value to a smaller type like INT or SMALLINT
- 3Aggregation functions (SUM, COUNT) accumulating values beyond the type limit over large datasets
- 4Arithmetic on DECIMAL columns where intermediate results exceed the defined precision
- 5An upstream data change introduced larger-than-expected numeric values
How to fix it
- 1Cast operands to a larger type before the operation: CAST(col AS BIGINT) * CAST(col2 AS BIGINT)
- 2Use TRY_CAST or TRY() to return NULL instead of raising an error on overflow
- 3Review the column definitions — switch from INT to BIGINT or DECIMAL with higher precision
- 4Inspect the actual data range: SELECT MAX(col), MIN(col) to see if the data exceeds type bounds
- 5Add a data quality check upstream to reject or flag rows with values outside the expected range