You can also consider using 'iso_week' instead of 'week' parameter in 'datepart'. This case you can avoid using 'set datefirst 1', which can be convenient if you can only use a single select.
More details here about 'iso_week': "ISO 8601 includes the ISO week-date system, a numbering system for weeks. Each week is associated with the year in which Thursday occur"
You can compare the two like this:
SELECT datepart(ISO_WEEK, '2020.01.01') -- Wed
SELECT datepart(WEEK, '2020.01.01') -- Wed
SELECT datepart(ISO_WEEK, '2020.01.05') -- Sun
SELECT datepart(WEEK, '2020.01.05') -- Sun
SELECT datepart(ISO_WEEK, '2020.01.06') -- Mon
SELECT datepart(WEEK, '2020.01.06') -- Mon
Note the difference for Sunday, 5 Jan 2020:
-----------
1
1
1
2
2
2
datepart()
. – Gordon Linoff Mar 14 '17 at 19:07