Hi Mike,

The underlying reason for the difference is that the columndProducts[StandardCost]is of typeCurrency(aka Fixed Decimal Number), while the other columns are of typeDecimal.

In particular:

- The Currency type stores decimal values with up to four decimal places (actually stored as integers divided by 10,000).
- When a Currency value is multiplied by a Decimal value in DAX, the result is a Currency value, resulting in potential loss of precision.
- The result is that the order of multiplication of 3 or more numbers matters when Currency and other types are mixed.

I am assuming that DAX multiplication is performed from left to right, so that in your case, the two calculations are as follows

([C]indicating Currency and[D]indicating Decimal):

- LineCOGS01 = ROUND ( 8.25
[C]* 0.953[D]* 131[D], 2)

= ROUND ( 7.8623[C]* 131[D], 2 )

= ROUND ( 1,029.9613[C], 2 )

= 1,029.96- LineCOGS02 = ROUND ( 131
[D]* 0.953[D]* 8.25[C], 2)

= ROUND ( 124.843[D]* 8.25[C], 2)

= ROUND ( 1,029.9548[C], 2)

= 1,029.95

Since LineCOGS02 multiplies by the Currency value last, the rounding to 4 decimal places (as a result of conversion to Currency) happens later.

To get the same result from these two formulas (and match Excel), you could change dProducts[StandardCost] to Decimal type.

By the way, I had to look up the detail on behaviour of these different types in this SQLBI article

https://www.sqlbi.com/articles/under...rsions-in-dax/

Regards,

Owen

## Like this thread? Share it with others