Forum Discussion
PaulaMA
2 years agoFrequent Visitor
Nested IF AND statement
Could anyone help me with this? I keep getting this error message Expression.Error: The name 'IF' wasn't recognized. Make sure it's spelled correctly Table.AddColumn(#"Added Conditional Colum...
mlsx4
Memorable Member
2 years agoHi PaulaMA
If you are using PQ, you need to change the syntax (you're mixing with DAX):
You should do something similar to this (could be some syntax error with parenthesis because of doing it here):
Table.AddColumn(#"Added Conditional Column1", "Custom", each if ([IncidentsPrevMth]-([NoofIncidentsLast12]/12))>0 and ([IncidentsPrev2ndMth]-([NoofIncidentsLast12]/12))>0 then
1 else 0)
I mean, if..then..else for the ifs conditions and the keyword "and" to do the AND