Forum Discussion
IF measure
| Model Name | OD1 | OD2 | OD3 | OD4 |
| A | YES | NO | NO | NO |
| C | NO | YES | NO | NO |
| B | YES | YES | NO | NO |
| C | NO | NO | NO | NO |
I would like to have a new column meet this condition:
If OD1 is Yes then "keep OD1"
If OD2 Is Yes and OD1 is NO, then "In OD2, sugguest OD1"
If OD1 and OD2 is yes then "keep OD1 and OD2"
If all OD is No then "Drop all"
Hi, SelflearningBi
Please try formula like:
Column = SWITCH ( TRUE (), 'Table'[OD1] = "Yes", "keep OD1", 'Table'[OD2] = "Yes", "suguest to use OD1", 'Table'[OD3] = "Yes", "suguest to use OD2", 'Table'[OD4] = "Yes", "suguest to use OD3", "Drop All" )Best Regards,
Community Support Team _ Eason
3 Replies
- amitchandakSuper User
SelflearningBi , A New Column Like
Switch( True(),
[OD1] = "Yes" && [OD2] = "Yes", "keep OD1 and OD2" ,
[OD1] = "Yes", "keep OD1" ,
[OD2] = "Yes", "In OD2, "sugguest OD1" ,
[OD1] = "No" && [OD2] = "No" && [OD3] = "No" && [OD4] = "No", "Drop all"
)
Create a new column like the above. Order of statement is important
- SelflearningBiHelper III
amitchandak
Hi thank you for helping, I was wondeirng is there a function we could say
if
OD1 is meet than keep OD1
OD2 is meet but OD1 is not meet then we suuguest to use OD1
OD3 is meet but OD2 is not then we sugguest to use OD2
Like I would like to suuguest to use previous one in all conditions- v-easonf-msftCommunity Support
Hi, SelflearningBi
Please try formula like:
Column = SWITCH ( TRUE (), 'Table'[OD1] = "Yes", "keep OD1", 'Table'[OD2] = "Yes", "suguest to use OD1", 'Table'[OD3] = "Yes", "suguest to use OD2", 'Table'[OD4] = "Yes", "suguest to use OD3", "Drop All" )Best Regards,
Community Support Team _ Eason