Forum Discussion

jaryszek's avatar
jaryszek
Super User
1 year ago
Solved

DecimalNumber with 15 max limit not working while aggregation

Hi Guys, i need to compare raw data agregated on visual (dax) or within power query with validation data like that: This is Cost for 1 month:  44666.17333394919842 as you can see it is 14 d...
  • ZhangKun's avatar
    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.