Reputation: 3
I'm kind of new to DAX and I'm basically learning as I'm using it in my work. We are building reports in PowerBI and we have data model that gets data from Oracle database. So I'm using DAX to create measures in this data model.
I need to substract 2 numbers from each other. So I created simple measure which looked like this: [MEASURE1] - [MEASURE2]
Whether it works or it doesn't depends on my Period filter which uses another table. I don't know how could period be related to any of this. So when I change filter to some values, I get normal number. However, when I switch it to different values, I get numbers like 2,27483058473905E-13.
Weird thing is that if I check those two measures that I'm subtracting, they have exactly the same numbers, so the difference should be 0.
I know this is not the best explanation, but it is impossible to describe entire data model here. So I'm just looking for some ideas what could possibly be causing this and what should I check.
I have literally no idea what could be causing this.
Upvotes: 0
Views: 331
Reputation: 4015
Floating point precision.
Either use fixed decimal data types, specify the format string of the measure, or wrap your measure in ROUND
, e.g.:
Diff =
ROUND (
[Measure 1] - [Measure 2] ,
2
)
Upvotes: 1
Reputation: 12375
2,27483058473905E-13 is not a huge number, but as close as a decimal calculator can get to zero.
Upvotes: 0