The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi all, I have a simple IF statement which is returning inconsistent results and I can'T figure out why. I would greatly appreciate any help in this.
This is the IF statement where I want it to return a "YES" when the value is less than 24 else "NO".
InboundTime(Hours) | KPI Achieved |
164 | YES |
2502 | NO |
-1 | YES |
22 | YES |
-1 | YES |
26 | NO |
26 | NO |
21 | YES |
145 | YES |
168 | YES |
50 | NO |
50 | NO |
1 | YES |
1 | YES |
50 | NO |
1517 | YES |
Solved! Go to Solution.
I would assume that the first column is not formatted correctly. Can you check that it's stored as whole number/decimal number?
I would assume that the first column is not formatted correctly. Can you check that it's stored as whole number/decimal number?
@Anonymous , @FrankAT I think that may be at the core of my woes. The column is a product of a datediff function. I reformmated my IF statement as IF('Inbound'[InboundTime(Hours)] <= 24 , "YES","NO") with a space after the 24 and it seems to be working, atleast for the sample data I have for now, it's returning concistent results.
Unfortunately this did not work in my case.
Hi @eWise ,
you try an alphabetical compare of text "24", so your "inconsistent results" are in this term correct.
If you want a numerical compare you can do it like this:
With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)
User | Count |
---|---|
65 | |
61 | |
60 | |
53 | |
30 |
User | Count |
---|---|
180 | |
88 | |
71 | |
48 | |
46 |