Forum Discussion
Anonymous
8 years agoNot applicable
IF DAX Statement
Hi,
I am looking for way to simply the following for a calculated column
Number of Interactions = if('Table 4'[Number of Weeks]=1,"1",IF('Table 4'[Number of Weeks]=2 || 'Table 4'[Number of Weeks]=3 || 'Table 4'[Number of Weeks]=4 || 'Table 4'[Number of Weeks]=5,"2-5"))So rather than use the || is there a way to say equal to and between these numbers....
Thanks..
Anonymous
test =
SWITCH (
TRUE (),
numberofweeks = 1, "1",
AND ( numberofweeks > 2, numberofweeks < 5 ), "2-4"
)
3 Replies
- vanessafvgCommunity Champion
Anonymous use the switch statement its so much easier
test =
SWITCH ( numberofweeks = 1, "1",numberofweeks = 2, "2",
etc)
- AnonymousNot applicable
Brill vanessafvg, is there a way though to say
test =
SWITCH ( numberofweeks = 1, "1",numberofweeks = 2 | 3 | 4 , "2-4",
etc)
?
Thanks
- vanessafvgCommunity Champion
Anonymous
test =
SWITCH (
TRUE (),
numberofweeks = 1, "1",
AND ( numberofweeks > 2, numberofweeks < 5 ), "2-4"
)