Forum Discussion
IF ELSE Statement for Column
I am trying to create an If Statement to create/group a column in the following order.
If Probability < 50 then it is "Early"
If Probability >= 50 or < 75 then it is "Warm"
If Probability is > 75 then it is "Late"
So far I have
I know I need an else statement toward the end but can't seem to get it right. Thank you in advance!
Hi actzikas
i dont think you need the last statement
IF(Opportunity[Probability] >= 75, "Late"because you have already described any of possible values.
so, you could leave just
Piepline Probability Stage = IF(Opportunity[Probability] < 50, "Early", IF(Opportunity[Probability] >= 50 || Opportunity[Probability] < 75, "Warm", "Late"))
5 Replies
- VasTgMemorable Member
It is easier to create a calculated Column in Edit Queries/Transform Data.
If this helps, accept it as a solution.
Kudos are good too.
- actzikasFrequent Visitor
Thank you for the conditional column advise, but I wanted to do this via an IF Statement so I marked the other one as the solution but as you stated both work!
- az38Community Champion
Hi actzikas
i dont think you need the last statement
IF(Opportunity[Probability] >= 75, "Late"because you have already described any of possible values.
so, you could leave just
Piepline Probability Stage = IF(Opportunity[Probability] < 50, "Early", IF(Opportunity[Probability] >= 50 || Opportunity[Probability] < 75, "Warm", "Late"))- actzikasFrequent Visitor
Thanks I just had to replace the || with && and it worked
- daxCommunity Support
Hi actzikas,
If you want to create calculated column, you could try to follow above suggestions. Or you also could use below expression
Column = SWITCH(TRUE(),'Table'[Column1]<50, "a", 'Table'[Column1]<75, "b", 'Table'[Column1]>=75 ,"c")Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.