Forum Discussion
JKoivu
5 years agoHelper I
Simple calcuation behaves oddly
Hi, I have a measure DAX similar to this example: Distance exceeded = VAR distance = MAX(MyTable[Distance from previous]) VAR maxDistance = [Max distance] VAR fraction = distance / maxDistance ...
- 5 years ago
Hi. Yes my issue is resolved, the reason was that there was a very obvious calculation error in my measure, which I failed to notice due to time pressure. Also the reason I was getting weird values for the calculation was because I put this measure in a table (for debugging purpose), and that messed up the context. So basically my whole question is not really valid...
amitchandak
5 years agoSuper User
JKoivu , You need to correct your return statement
Distance exceeded =
VAR distance = MAX(MyTable[Distance from previous])
VAR maxDistance = [Max distance]
VAR fraction = distance / maxDistance
RETURN if( fraction > 1,[fraction]+1,[fraction])