Forum Discussion
asheyashey
10 months agoHelper I
Make a slicer for Current week,Week+1,Week+2,Week+3
As mentioned in Title. I want a slicer like this. I have a date column(dd/mm/yyyy). Can anyone guide me how to approach this specific problem.
- 10 months ago
Seems like yo uneed to filter on 5 weeks so you can create column preferably on your calendar/date table, but can be also be use on any date column, but you could be missing weeks where there is no value for the week.
Create a column: 0 will be your current week, 1 next week etc. or -1 previous week -2 previous weekRelative Week = DATEDIFF(TODAY(),'Date'[Date], WEEK)
You can also create another column to play around with the naming convention.
example:
WeekDesc =SWITCH(TRUE(),DATEDIFF(TODAY(),'Date'[Date], WEEK) = 0, "Current Week" -- Week 1,DATEDIFF(TODAY(),'Date'[Date], WEEK) = 1, "Week 2",DATEDIFF(TODAY(),'Date'[Date], WEEK) = 2, "Week 3",DATEDIFF(TODAY(),'Date'[Date], WEEK) = 3, "Week 4","Week +" & 'Date'[Relative Week])
when you create your slicer just filter on the weeks you want to bring. in the example would be relative week 0, 1, 2, 3, 4. Next week then it would move all the numbers up or down depending if you are looking at next or previous week.
Bmejia
10 months agoSuper User
Seems like yo uneed to filter on 5 weeks so you can create column preferably on your calendar/date table, but can be also be use on any date column, but you could be missing weeks where there is no value for the week.
Create a column: 0 will be your current week, 1 next week etc. or -1 previous week -2 previous week
Relative Week = DATEDIFF(TODAY(),'Date'[Date], WEEK)
You can also create another column to play around with the naming convention.
example:
when you create your slicer just filter on the weeks you want to bring. in the example would be relative week 0, 1, 2, 3, 4. Next week then it would move all the numbers up or down depending if you are looking at next or previous week.
You can also create another column to play around with the naming convention.
example:
WeekDesc =
SWITCH(TRUE(),
DATEDIFF(TODAY(),'Date'[Date], WEEK) = 0, "Current Week" -- Week 1
,DATEDIFF(TODAY(),'Date'[Date], WEEK) = 1, "Week 2"
,DATEDIFF(TODAY(),'Date'[Date], WEEK) = 2, "Week 3"
,DATEDIFF(TODAY(),'Date'[Date], WEEK) = 3, "Week 4",
"Week +" & 'Date'[Relative Week])
when you create your slicer just filter on the weeks you want to bring. in the example would be relative week 0, 1, 2, 3, 4. Next week then it would move all the numbers up or down depending if you are looking at next or previous week.