Forum Discussion
DecimalNumber with 15 max limit not working while aggregation
- 1 year ago
The calculation order of double-precision floating-point numbers may lead to different results because the last digit is rounded differently in the calculation. For example, the following example:
List.Transform({{-0.4, 0.1, 0.2, 0.3, -0.31, 0.1, 0.01}, {-0.4, 0.1, -0.31, 0.1, 0.01, 0.2, 0.3}}, List.Sum)Numbers in Power Query are all treated as double-precision floating point numbers, but some functions can specify the calculation precision (double-precision floating point or fixed-digit decimals), such as the following example:
List.Transform({{-0.4, 0.1, 0.2, 0.3, -0.31, 0.1, 0.01}, {-0.4, 0.1, -0.31, 0.1, 0.01, 0.2, 0.3}}, each List.Sum(_, Precision.Decimal))This is difficult to guarantee in DAX because the only currency types that guarantee precision are only accurate to 4 decimal places.
Hi jaryszek I think it might be related to IEEE 754 floating-point arithmetic, which can cause minor precision errors during aggregation. Power Query and DAX may display extra digits due to these rounding artifacts. To ensure consistent precision, consider using Number.Round in Power Query or ROUND in DAX to limit decimals explicitly.