Week on week trend to show last 5 weeks based on year ,month and week selections
I have a date column from which I need to plot a line graph with weeks in axis.I ahve year,month and week filter.If the selections are year-2022,month- Feb ,Week - WK7,then graph should show WK3,WK4,WK5,WK6,WK7.
@ann33 , if you want to select a week and then display 5 weeks , you need two date table on joined and another one independent for slicer
//Date1 is independent Date table, Date is joined with Table new measure = var _max = maxx(allselected(Date1),Date1[week Rank]) var _min = _max -5 return calculate( sum(Table[Value]), filter('Date', 'Date'[week Rank] >=_min && 'Date'[week Rank] <=_max))
For week rank, create new column in both date tables
Have these new columns in Date Table, Week Rank is Important in Date/Week Table
Week Rank = RANKX('Date','Date'[Week Start date],,ASC,Dense) OR Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense) //YYYYWW format