Forum Discussion
DAX function not calculating decimal values correctly.
- Anonymous1 year ago
abansalgeoforce, Looks like Power BI is auto-converting the result to a fixed decimal with low precision at some point in the DAX chain.
Hi abansalgeoforce,
This is definitely a formatting issue, not a DAX calculation issue.
To resolve this: Go to Format, increase Decimal places from 2 to at least 3 or more.
Regards,
Vinay Pabbu
column1 here is set to decimal with 3 precision.
And the below calculation is giving me value 0.40 instead of 0.33
"var1 > 5 &&var1 <= 10, (var1 - 5) / 5" ,
var1= 6.66
(6.66-5)/5 = 1.66/5 = 0.332.
Even if its rounding to 2 decimals, i should get value as 0.33. However, the value i finally get is 0.40.
The final measure (for which DAX formula i provided above) is set to decimal,2. However, with the interim calculation not being correct, the value is 0.40 instead of 0.33.
- Anonymous1 year agoNot applicable
Hi abansalgeoforce,
The issue could be caused by implicit type conversion or a column misreference in your DAX logic.
Try with simplified test measure to isolate the issueIf you still see 0.40 instead of 0.332: It's likely that column1 is being rounded earlier, possibly in Power Query.
Regards,
Vinay Pabbu
- abansalgeoforce1 year agoFrequent Visitor
Thanks Anonymous . I tried exactly the same. When I use just column1, I see value 6.66. When I do column1-1, I get 1.66. The moment I do (column1-1)/5, I get 0.4
- Anonymous1 year agoNot applicable
abansalgeoforce, Looks like Power BI is auto-converting the result to a fixed decimal with low precision at some point in the DAX chain.