Forum Discussion
Blitz_40
5 years agoNew Member
Nested if with five condition
Hi! I am new to PBI and DAX. I've done a few simple If statements, but have not been able to figure this one out. I know this is probably elementary, but I have spent the about three hours trying to ...
- 5 years ago
Blitz_40 - Use a SWITCH(TRUE()...) statement, not nested IF statements. Logic is cleaner, will make things very easy.
Column = SWITCH(TRUE(), [Sum of Days]>1 && [Sum of Days]<=3,”Daily”, [Sum of Days]>3 && [Sum of Days]<=18,”Weekly”, [Sum of Days]>18 && [Sum of Days]<=28,”Monthly”, [Sum of Days]>29,”Other”, BLANK() )
Greg_Deckler
5 years agoCommunity Champion
Blitz_40 - Use a SWITCH(TRUE()...) statement, not nested IF statements. Logic is cleaner, will make things very easy.
Column =
SWITCH(TRUE(),
[Sum of Days]>1 && [Sum of Days]<=3,”Daily”,
[Sum of Days]>3 && [Sum of Days]<=18,”Weekly”,
[Sum of Days]>18 && [Sum of Days]<=28,”Monthly”,
[Sum of Days]>29,”Other”,
BLANK()
)Blitz_40
5 years agoNew Member
Greg_Deckler Thank you! I will be frank and say that I am not familiar with SWITCH.
I need to explore the difference so I can understand the application. I appreciate it!