Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
i'm trying to create a complex formula that go through many ramifications that perform different calculations, but i'm not getting the proper evaluation in custom column with an if-and-or formula. I simplified my formula to this simple one:
if (([Categorização Final] <> "Supplies" or [Categorização Final] <> "Packaging") and Date.Year([Data do Pedido]) < 2019) then "S<19" else "S>19"
I removed "and Date.Year([Data do Pedido]) < 2019" in order to simplify more, but the "or" operator does not work.
In both cases i'm getting the "S<19" result for all records, even when output should be "S>19"
Note:
The field [Categorização Final] is set to Any (but I tried with the Text option too)
Original snippet
What is wrong in my code, can someone show me what i'm missing here?
Solved! Go to Solution.
hi @Anonymous
For your case, you just use 'and' instead of 'or' as below:
if (([Categorização Final] <> "Supplies" and [Categorização Final] <> "Packaging") and Date.Year([Data do Pedido]) < 2019) then "S<19" else "S>19"
Result:
Regards,
Lin
hi @Anonymous
For your case, you just use 'and' instead of 'or' as below:
if (([Categorização Final] <> "Supplies" and [Categorização Final] <> "Packaging") and Date.Year([Data do Pedido]) < 2019) then "S<19" else "S>19"
Result:
Regards,
Lin
Hi,
[Categorização Final] <> "Supplies" or [Categorização Final] <> "Packaging"
This is incorrent , there is no possible way for this to return false.
Since both the comparison operators are "<>" and then it's combined with an OR statement they cancel eachother out.
Br,
J
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
120 | |
101 | |
71 | |
61 |