Forum Discussion
Label a date column for future weeks
- 5 years ago
If you create a Date table (with a CALENDAR or CALENDARAUTO statement - you can limit this from current date to 18 weeks on, if required) , you can create a weekNo column with something like this:
WeekNo = WEEKNUM(TableDates[Date]) - WEEKNUM(NOW())That'll give the offset from the WEEKNUM of each date value.
Link the Date table to your Fact table.
The Date table will recalculate when the data is refreshed
Please test at your side because I threw this together quickly.
- Anonymous5 years ago
This worked. Thanks a lot for help.
If you create a Date table (with a CALENDAR or CALENDARAUTO statement - you can limit this from current date to 18 weeks on, if required) , you can create a weekNo column with something like this:
WeekNo = WEEKNUM(TableDates[Date]) - WEEKNUM(NOW())
That'll give the offset from the WEEKNUM of each date value.
Link the Date table to your Fact table.
The Date table will recalculate when the data is refreshed
Please test at your side because I threw this together quickly.
This worked. Thanks a lot for help.