Forum Discussion
KW123
3 years agoHelper V
Year Diff with Slicer
Hi, I have a column that shows the year difference between opening and account and closing the account. I'd like to make a slicer which has the following options SLICER: <1 year 1-3 years ...
- 3 years ago
Hi ,
How about this:
SWITCH ( TRUE, 'Query1'[Year Diff] < 1,"<1", 'Query1'[Year Diff] >= 1 && 'Query1'[Year Diff] <= 3,"1-3", 'Query1'[Year Diff] >= 4 && 'Query1'[Year Diff] <= 5,"4-5", ">5" )
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
KW123
3 years agoHelper V
if ('Query1'[Year Diff] <1,"<1",
if ('Query1'[Year Diff] = 1 || 2 || 3, "1-3",
if ('Query1'[Year Diff] = 4 || 5 ,"4-5",
if ('Query1'[Year Diff] >5, ">5"))))
I have that but I am not sure where to put the ELSE. It seems as though the DAX works for <1 and 1-3 but it is not producing the 4-5 or >5
I have that but I am not sure where to put the ELSE. It seems as though the DAX works for <1 and 1-3 but it is not producing the 4-5 or >5
tackytechtom
3 years agoMost Valuable Professional
Hi ,
How about this:
SWITCH (
TRUE,
'Query1'[Year Diff] < 1,"<1",
'Query1'[Year Diff] >= 1 && 'Query1'[Year Diff] <= 3,"1-3",
'Query1'[Year Diff] >= 4 && 'Query1'[Year Diff] <= 5,"4-5",
">5"
)
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
- KW1233 years agoHelper V
tackytechtom
Thank you so much, this is exactly what I am looking for!