Forum Discussion
Week commencing in DAX
- 8 years ago
Hey,
just try this "simple" DAX statement
SoWDate = 'Calendar'[Date] - WEEKDAY('Calendar'[Date],2) +1The second parameter of the WEEKDAY()-function indicates if Sunday or Monday is your first day of the week, for me this works like a charm, maybe you have to use a different correction part.
Just using your Date column and the "Day of Week" column helps to adjust the above mentioned formula if necessary.
and this calculates the End Date of the weekEoWDate = 'Calendar'[Date] + 7 - WEEKDAY([DATE],2)
Hope this helps
Regards
Hey,
just try this "simple" DAX statement
SoWDate = 'Calendar'[Date] - WEEKDAY('Calendar'[Date],2) +1The second parameter of the WEEKDAY()-function indicates if Sunday or Monday is your first day of the week, for me this works like a charm, maybe you have to use a different correction part.
Just using your Date column and the "Day of Week" column helps to adjust the above mentioned formula if necessary.
and this calculates the End Date of the week
EoWDate = 'Calendar'[Date] + 7 - WEEKDAY([DATE],2)
Hope this helps
Regards
Well, only if you accept that week 1 can start in the year before this, in quite a lot of countries week 1 is the week 1ith 1 January in it and can be 1-7 days. That complicates matters