I'm facing a validation error in Dataverse when trying to store values in a calculated column named 'Margem'. The error indicates that the value is outside the valid range. Here's the error message I received:

The 'Margem' column is calculated with the following formula:
Margem = [Valor_Venda_S_IVA] - [Preco_Custo_S_IVA_produto]
To prevent values from exceeding the maximum allowed range, I've attempted to introduce an if statement to limit the output of the formula. Despite this, the error suggests that the calculated value is reaching 2.42E+17, which is significantly higher than the maximum permitted value of 1,000,000,000.

Additionally, I've sorted the 'Margem' values in both ascending and descending order to identify any abnormal values that might correspond to the error message's value size, but this has not clarified the issue.
This seems to be a straightforward calculation, yet I am encountering this error on four different columns that perform similar calculations. I'm at a loss as to why this is happening.
Has anyone encountered this issue or can anyone advise on a solution? Any insights or suggestions to resolve this validation error would be greatly appreciated.
