Forum Discussion
snamhoang
9 years agoNew Member
Create Week column starting from Tuesday and ending next Tuesday
Hi guys,
I am trying to create a week column (displaying week number) which starts from Tuesday and ends next Tuesday.
Any suggestion?
I used Weeknum 21 but it starts from Mon, not Tue.
Thanks a lot
Hi snamhoang
Please add this calculated column to your Calendar table
Week Starting Tuesday = var offset = switch(FORMAT('Dates'[Date],"DDD"), "Tue",0, "Wed",-1, "thu",-2, "Fri",-3, "Sat",-4, "Sun",-5, "Mon",-6 ,0) Return DATEADD('Dates'[Date],offset,DAY)
2 Replies
- Phil_Seamark
Microsoft Employee
Hi snamhoang
Please add this calculated column to your Calendar table
Week Starting Tuesday = var offset = switch(FORMAT('Dates'[Date],"DDD"), "Tue",0, "Wed",-1, "thu",-2, "Fri",-3, "Sat",-4, "Sun",-5, "Mon",-6 ,0) Return DATEADD('Dates'[Date],offset,DAY)