Forum Discussion
IF statment doesn't work!
- 9 years ago
Hi Anonymous,
Thanks for your replay. I have tried both option, but I kepp getting the same error: "Expression.Error: The name 'IF' wasn't recognized. Make sure it's spelled correctly."
Beyondforce Are you creating a Calculated column?
- Beyondforce9 years agoHelper I
I have 2 columns with 1 and 0. In the new column I want to create 4 option:
LateStart LateEnd Status
0 0 0
1 0 1
0 1 2
1 1 3I need to use the IF and AND statment to create the result in the "Status" column. Later I'll use a color condition for all the 4 number options in the Status column.
- Vvelarde9 years agoCommunity Champion
- Beyondforce9 years agoHelper I
In here:
- Anonymous9 years agoNot applicable
Status = IF(AND('Table1'[LateStart] = 0, 'Table1'[LateEnd]= 0), 0, IF(AND('Table1'[LateStart] = 1, 'Table1'[LateEnd]= 0), 1, IF(AND('Table1'[LateStart] = 0, 'Table1'[LateEnd]= 1), 2, IF(AND('Table1'[LateStart] = 1, 'Table1'[LateEnd]= 1), 3, 99) ) ))You can use the above if you are in the model using DAX. (Noted after seeing VV posted.)
- Beyondforce9 years agoHelper I
Anonymous, I have tried you script, but it still doesn't work!
Vvelarde I have tried your script and it's working :)
Thank you both for your time and help.
Cheers.