Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 |
Solved! Go to Solution.
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())
Proud to be a Super 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?
Proud to be a Super User!
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
@v-junyant-msft - Thanks I now got the result. Is there a way I can get the same result with measure instead of the column?
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())
Proud to be a Super User!
hi @gaurav-narchal please check your data types, are amount and balance text or numeric.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
141 | |
107 | |
100 | |
82 | |
74 |