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.
If we go by option (A)
In your dateTable (or wherever your dates are) enter the following as a calculated column formula:
Custom Week that starts on Tuesdays = WEEKNUM ( DimDate[Date] - 1; 2 )
Now all weeks start on Tuesdays and end on Mondays
Edit:
Dimdate being 'YourTable" and [Date] being 'YourDateColumn'
- nroeder079 years agoFrequent Visitor
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.
- Anonymous9 years agoNot applicable
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