Forum Discussion
Custom Week filter
- 9 years ago
This works
EstimateWeek =[Estimate Date Year Number]*100+Date.WeekOfYear([Estimate Date],2)
TodayWeek=Date.Year(DateTime.LocalNow())*100+Date.WeekOfYear(DateTime.LocalNow(),2)
PreviousSalesWeek=if [EstimateWeek]-[TodayWeek]=-1 then 0 else 1
However I'm going to have an issue on the year transition.
This works
EstimateWeek =[Estimate Date Year Number]*100+Date.WeekOfYear([Estimate Date],2)
TodayWeek=Date.Year(DateTime.LocalNow())*100+Date.WeekOfYear(DateTime.LocalNow(),2)
PreviousSalesWeek=if [EstimateWeek]-[TodayWeek]=-1 then 0 else 1
However I'm going to have an issue on the year transition.
Hi nroeder07,
>>However I'm going to have an issue on the year transition.
You can add a condition to check the week number. If week number =1, you can use the date range of previous year 12.31 's week to filter.
Regards,
Xiaoxin Sheng