Forum Discussion
Measure - Greator than
Hello
I need help to create a measure as below
If the balance is greater than or equal to the Amount return TRUE or else FALSE. I tried to create a measure but did not get the desired result as some of the Amounts are in Negative.
Table 1
| Number | Amount | Balance | Result |
| 123456 | 132 | 150 | TRUE |
| 624970 | -27337.5 | -32337.5 | TRUE |
| 1126484 | -6156.25 | -11156.25 | TRUE |
| 1627998 | -102790 | -107790 | TRUE |
| 2129512 | -41545 | -46545 | TRUE |
| 2631026 | -8380 | -2580 | FALSE |
| 3132540 | -29475 | -7980 | FALSE |
| 3634054 | 390 | 5390 | TRUE |
| 4135568 | 9460 | 14460 | TRUE |
| 4637082 | 2460 | 7460 | TRUE |
| 5138596 | 1950 | 6950 | TRUE |
| 5640110 | 1950 | 6950 | TRUE |
| 6141624 | 200 | 200 | FALSE |
| 6643138 | 19485 | 18000 | FALSE |
- Anonymous2 years ago
Hi gaurav-narchal ,
Hi ryan_mayu , I'm guessing OP is trying to calculate the magnitude of the absolute value🤔. The expected results given by the OP are in perfect agreement with the comparison of absolute magnitudes😀.
Just change your DAX into this:Column = if(ABS('Table'[Balance])>ABS('Table'[Amount]),TRUE(),FALSE())Anyway, good answer!
Best Regards,
Dino Tao Pls try
Measure = IF(SUM('Table'[Balance])>SUM('Table'[Amount]),TRUE(),FALSE())or
Measure2 = IF(ABS(SUM('Table'[Balance]))>ABS(SUM('Table'[Amount])),TRUE(),FALSE())
5 Replies
- ryan_mayuSuper User
maybe you can try this
Column = if('Table'[Balance]>'Table'[Amount],TRUE(),FALSE())why the result for second row (624970) is True? the balance is less than amount.
could you pls elaborate the logic?
- AnonymousNot applicable
Hi gaurav-narchal ,
Hi ryan_mayu , I'm guessing OP is trying to calculate the magnitude of the absolute value🤔. The expected results given by the OP are in perfect agreement with the comparison of absolute magnitudes😀.
Just change your DAX into this:Column = if(ABS('Table'[Balance])>ABS('Table'[Amount]),TRUE(),FALSE())Anyway, good answer!
Best Regards,
Dino Tao- gaurav-narchalHelper I
Anonymous - Thanks I now got the result. Is there a way I can get the same result with measure instead of the column?
- rubinboerResolver II
hi gaurav-narchal please check your data types, are amount and balance text or numeric.