I am trying to get the weeknumber for a month from a give date. using following method:
Created a calculated field for 'week of the year': as A
DATEPART('week',[Date],'monday')
created a calculated field for "week of start date" : as B
DATEPART('week',DATETRUNC('month',[Date]),'monday')
Hence week =
A-B+1
Also, I am calculating Week Start Date using:
DATETRUNC('week',[Date],'monday')
I am facing one issue: For instance, date: 08/31/2020 ( This is monday) This is showing as week 6 for August as well as week 1 for September which it should not show. Week 1 for September should be 09/01/2020.
Can anyone help me on this?
week 1
for09/01/2020
when the week is not starting on Monday? Do you want the values as given in solution proposed by me? please check – AnilGoyal