Forum Discussion
How to resolve floating numbers in PQ - addition
- Anonymous1 year ago
Hi non23 ,
Based on your description, it's not clear how your TAX column is formed; if it's said to be derived from a ratio multiplied by sales, it's easy to see why you have so many decimal places. And based on your results, rounding would end in either 8 or 805, it wouldn't round up plus one. So you might try using Number. round() twice.= [Sales] + Number.Round(Number.Round([Tax],3),2)Final output
Best regards,
Albert HeIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly
non23
You can use a precision type within a Value expression, for example:
Value.Add([Sales], [Tax], Precision.Decimal)
I hope this is helpful
I tried following it but the result is still giving 3 decimal places. Also changed the format to fixed decimal number still the result is 3 decimal places.
- m_dekorte1 year ago
Resident Rockstar
Hi non23,
Alternatively, instead of using a precision type, you can go for a different approach. Using a rounding function like Number.Round, and a RoundingMode type.Number.Round( [Sales] + [Tax], 2, RoundingMode.AwayFromZero )I hope this is helpful