Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply

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

 

NumberAmountBalanceResult
123456132150TRUE
624970-27337.5-32337.5TRUE
1126484-6156.25-11156.25TRUE
1627998-102790-107790TRUE
2129512-41545-46545TRUE
2631026-8380-2580FALSE
3132540-29475-7980FALSE
36340543905390TRUE
4135568946014460TRUE
463708224607460TRUE
513859619506950TRUE
564011019506950TRUE
6141624200200FALSE
66431381948518000FALSE
2 ACCEPTED SOLUTIONS

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

View solution in original post

@gaurav-narchal 

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())

11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
ryan_mayu
Super User
Super User

@gaurav-narchal 

maybe you can try this

Column = if('Table'[Balance]>'Table'[Amount],TRUE(),FALSE())

11.PNG

 

why the result for second row (624970) is True? the balance is less than amount.

could you pls elaborate the logic?





Did I answer your question? Mark my post as a solution!

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?

@gaurav-narchal 

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())

11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




rubinboer
Resolver II
Resolver II

hi @gaurav-narchal please check your data types, are amount and balance text or numeric.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.