Group dates by week where Monday is first day of week

meileetan

Board Regular
Joined
Aug 18, 2005
Messages
86
I have a column of dates. I see I can transform that column by Start of Week but how do I specify that Monday is the first day, instead of the default Sunday?

= Table.TransformColumns(#"Renamed Columns",{{"Week", Date.StartOfWeek, type date}})
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Power Query:
= Table.TransformColumns(#"Renamed Columns",{{"Week", each Date.AddDays(Date.StartOfWeek(_),1), type date}})
 
Upvote 0
Power Query:
= Table.TransformColumns(#"Renamed Columns",{{"Week", each Date.AddDays(Date.StartOfWeek(_),1), type date}})
Ooh! Very close :) I originally thought your solution worked but then realised: it's marking Sunday 13 Feb 2022 in my new "Week starting" column as Monday 14 Feb. My desired outcome is for Sunday 13 Feb to fall in week starting 7 Feb.
 
Upvote 0
If you use -1 instead of 1 does it produce the result you're after?
 
Upvote 0
= Table.TransformColumns(#"Renamed Columns",{{"Week", each Date.AddDays(Date.StartOfWeek(_),-1), type date}})
If you use -1 instead of 1 does it produce the result you're after?
For dates 6-11 Feb, the Week Starting date is 5 Feb.
I expect 6 Feb to be in Week Starting 31 Jan
And 7-11 Feb to be in Week Starting 7 Feb
 
Upvote 0
maybe

Power Query:
= Table.TransformColumns(#"Renamed Columns",{{"Date", each Date.AddDays(Date.StartOfWeek(Date.AddDays(_,-1)),1), type date}})
 
Upvote 0
maybe

Power Query:
= Table.TransformColumns(#"Renamed Columns",{{"Date", each Date.AddDays(Date.StartOfWeek(Date.AddDays(_,-1)),1), type date}})
Works!
In parallel, a colleague shared this, which I think is neater. I really appreciate your help anyway!
1. Add Custom column
2. Type formula: =Date.StartOfWeek([Date],Day.Monday)
Where the underlined "Date" is the column you are referring to, to return the "Week starting on" value.
 
Upvote 0
Solution

Forum statistics

Threads
1,223,674
Messages
6,173,746
Members
452,533
Latest member
Alex19k

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top