Announcements
cancel
Showing results for
Did you mean:
Creator

## If statement with Not Equal to

Hello All,

I am trying to work through a detailed requirement based on various criteria, but I cannot figure out how to include the "not equal" factor into the formula.

Does anyone know how to resolve this?

What I am trying:

if(NPV<0, fAbs(NPV)
,if(NPV = 0 AND [Stage] = 'New' ,0
,if(NPV = 0 AND [Stage] <> 'Archived' AND Sum([Spend)])<>0,((Sum[Spend])*2))

,NPV)

)))

 Spend NPV Stage Expected RESULT 10 0 Alpha 20 0 0 New 0 5 -2 Alpha 2 3 1 New 1 -5 3 New 3 7 3 Archived 3
Labels (3)

• ### filter

1 Solution

Accepted Solutions
Partner - Master

Hello! It should work except for some misplaced parentheses. Also, you have uncheck the "Suppress Zero Values" or "include zero values" checkbox.

If(NPV < 0, fAbs(NPV),
If(NPV = 0 AND [Stage] = 'New', 0,
If(NPV = 0 AND [Stage] <> 'Archived' AND Sum([Spend]) <> 0, Sum([Spend]) * 2, NPV )))

2 Replies
Partner - Master

Hello! It should work except for some misplaced parentheses. Also, you have uncheck the "Suppress Zero Values" or "include zero values" checkbox.

If(NPV < 0, fAbs(NPV),
If(NPV = 0 AND [Stage] = 'New', 0,
If(NPV = 0 AND [Stage] <> 'Archived' AND Sum([Spend]) <> 0, Sum([Spend]) * 2, NPV )))

Creator
Author

Great...This is it! thanks @BrunPierre !