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
lsldufan
Regular Visitor

IF AND statement give me a wrong result

I created a column called A Achieved which =1 if  all total score>=1.8,classification=A else =0

Seems all result correct but 1, I don't know where is wrong, is it something wrong with the data or with my expression? Many thanks

lsldufan_0-1649254464323.png

 

1 ACCEPTED SOLUTION
lsldufan
Regular Visitor

I fix the issue by changing data type from number decimal to number decimal fixed, and change back to number decimal

View solution in original post

6 REPLIES 6
lsldufan
Regular Visitor

I fix the issue by changing data type from number decimal to number decimal fixed, and change back to number decimal

lsldufan
Regular Visitor

I cleanned the data, and did a test, when I set total impact as 2.8, then it will follow the fomula, so I don't think this is the data format issue, I think both classification and total impact were calculate correct, but don't know why it was not follow fomula when the result =1.8

daXtreme
Solution Sage
Solution Sage

Can't you just write several simpler formulas/columns to diagnose whether the problem comes from the text field or the numeric one? Having an AND condition to troubleshoot is not the best idea.

Whitewater100
Solution Sage
Solution Sage

Hi:

You formula looks normal.

I have a measure like this:

IF(

   AND(Table[actcod] = “CASRPL”,

       Table[Time over/under] = “Time Under 5”),

   1), BLANK()

)

 

I'm wondering if you can add a ) after the first 1     >=1.8,1),0)

daXtreme
Solution Sage
Solution Sage

Before you load data into PowerBI, cleanse it well in the source or in Power Query. Do not ever trust your eyes.

johnt75
Super User
Super User

Is there trailing whitespace in the classification column on that particular row ?

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.

Top Solution Authors