Forum Discussion
Help with IF statement
- Anonymous6 years ago
HI OPS-MLTSD
You need to revisit the range of 'IHSP - work plan'[3-Yr LTI per 100]
as per your formula
>=5 High <1 Low >=1(is it 'and <2'?????) Medium >=2 to <5(Ths range is not present) ???????(lets assume Medium High) Try this
3 Yr LTI Risk = IF('IHSP - work plan'[3-Yr LTI per 100] >=5, "High",
IF('IHSP - work plan'[3-Yr LTI per 100] <1, "Low",
IF('IHSP - work plan'[3-Yr LTI per 100] >=1 && 'IHSP - work plan'[3-Yr LTI per 100] <2, "Medium",IF('IHSP - work plan'[3-Yr LTI per 100] >=2 && 'IHSP - work plan'[3-Yr LTI per 100] <5,"Medium High",
"Not Available")
)
)
)
Did I resolve your issue? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!!
Regards,
Pranit
This the Power Query board and that is a DAX expression, but no problem. You have 4 terms in your last IF. You need to combine the >=1 and <2 parts with an AND() or connect them with "&&" so you check it returns true only if both are true. In any case, it would be better to write this expression using the SWITCH(TRUE(), ...) pattern. Please see this article. It is a much better way to write nexted IFs like this.
https://powerpivotpro.com/2015/03/the-diabolical-genius-of-switch-true/
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
Moved to the Desktop (DAX) forum. 😉