Forum Discussion
Dynamic slicer
Hi, I have a table that includes date column. I want to filter the table based on the following criteria. How can I make a slicer including them?
1- Date difference with today is more than 90 days.
2- Date difference with today is more than 180 days.
3- Date difference with today is more than 365 days.
4-Date difference with today is more than 730 days.
5 Replies
- IdrissshatilaSuper User
Hello koorosh ,
so first of all you have to create a datediff column between the date column and today.
the next step is to create a new column based on the date diff column where you categorize the result in which if the value is >= 90 && values < 180 then "90 Days" else if ...... and you continue to specify the others.
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
- kooroshPost Partisan
Hi, thank you.But I do not want to make the group by more than 90 less than 180. I want to filter the table with more than 90 days difference once. Another attempt, filter with more than 180 days difference. Third option filter with more than 365 days difference. Fourth attempt fitlter with more than 730 days difference.
So the slicer should have four options.
- ArulSuper User
koorosh ,
I am not sure whether I understand your requirement right or not, but below is what I tried based on my understanding?
New Date Table = VAR _dateTable = DIM_DATE VAR _today = TODAY() RETURN UNION( ADDCOLUMNS(FILTER(_dateTable,[Date]>_today-90),"Period","Last 90 Days","Order",1), ADDCOLUMNS(FILTER(_dateTable,[Date]>_today-180),"Period","Last 180 Days","Order",2), ADDCOLUMNS(FILTER(_dateTable,[Date]>_today-365),"Period","Last 365 Days","Order",3), ADDCOLUMNS(FILTER(_dateTable,[Date]>_today-730),"Period","Last 730 Days","Order",4) )Thanks,
Arul
- kooroshPost Partisan
I am looking to define 4 variables that each one filters the table based on differenc days. Then put these variables in a slicer.