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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Pwilson460
New Member

Simple IF statement returning incorrect results

Hello all, 

 

I am pretty new to DAX but have spent a lot of time using excel. 

 

I created this simple measure to allow users to filter a report for line items that are showing a negative balance by using a slicer. 

 

HighRisk_Under0 = IF(  AR[Cash-NetSales]  > 0 ,"Low Risk","High Risk")
 

The AR[Cash-NetSales] measure is just what it sounds like, current cash minus current net sales, and that measure works perfectly. 

 

However when I select the "High Risk" check box on my newly created slicer it shows some lines in the visual with a positive value, I am expecting it to only show negative values.

 

What am I missing here?

 

Thanks so much 

 

1 ACCEPTED SOLUTION

Hi @Pwilson460 
I replicated your scenario and it works as it should :

Ritaf1983_0-1716607183416.png

Ritaf1983_1-1716607223537.pngRitaf1983_2-1716607268571.png

The pbix is attached, you can follow my steps

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

5 REPLIES 5
Pwilson460
New Member

Here is a table of sample data I have been using.  I would expect all results labeled with "High Risk" to be negative from the following expression. 

 

HighRisk_Under0 = IF(  AccountReceivable[CashLast4-NetLast4]  > 0 ,"Low Risk","High Risk")

 

Company NameSales Last 4 WeeksCash Last 4 WeeksVarianceHighRisk_Under0
AAA$177,884$819($177,065)High Risk
BBB$15,810$12,468($3,341)High Risk
CCC$90,722$134,205$43,483High Risk
DD$7,020$16,155$9,135High Risk
FFF$16,155$24,660$8,505High Risk
GGG$20,996$16,262($4,734)High Risk

Hi @Pwilson460 
I don't see the " NetLast4"...in this table...
Is the HighRisk_Under0  measure or calculated column...?

It's still unclear what your data structure is and what you're trying to achieve.

 

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

NetLast4 is the Sales last 4 weeks column, CashLast4 is the cash last 4 weeks column. 

 

You are correct I misspoke, the HighRisk_Under0 is a calculated column.  

 

 

Hi @Pwilson460 
I replicated your scenario and it works as it should :

Ritaf1983_0-1716607183416.png

Ritaf1983_1-1716607223537.pngRitaf1983_2-1716607268571.png

The pbix is attached, you can follow my steps

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
Ritaf1983
Super User
Super User

Hi @Pwilson460 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors