Forum Discussion
Week starting Wednesday
- Anonymous9 years ago
Create this as a calculated column wherever you want to do your date filtering (i.e. Date table)
WEEKNUM = IF( WEEKDAY([Date], 1) < 4), WEEKNUM([Date], 1), WEEKNUM([Date], 1) + 1 )
This will place Week Numbers next to all of your lines. Now you can do your filtering based on Weeknumbers. If you do this as part of a Date Dimension table, you can do a lookup from any date to the WeekNumber
Anonymous correct me if i'm wrong, but doesn't WEEKDAY only return a value between 1 and 7? Also doesn't the 2nd parameter only accept values 1, 2, or 3 rather than the 13 you have suggested?
https://msdn.microsoft.com/en-us/library/ee634550.aspx
My understanding is that Chau wanted a set of week numbers in order to do filters for reporting.
Actually she is correct!
I have a client whose fiscal starts on 11/1/17 and their Week 1 = 11/1 - 11/7 so I used this formula after creating a new column to set the 11/1 to week 1, 11/8 to week 2, etc
Client Week = WEEKNUM([date],13)-44