PowerQuery formula for finding a week start date for weeks that start on Saturday

Monsignor

Board Regular
Joined
May 30, 2011
Messages
162
I have weeks that run Saturday to Friday and have a formula in native Excel for looking at a date and calculating the right Saturday.

M language has a weekstart function that defaults to Sunday. What would be a formula for calculating Saturday, instead?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hi There is not a weekstart function in M language. It has Date.StartOfWeek.
Code:
 let     source = Date.StartOfWeek(DateTime.LocalNow(), Day.Saturday) in     source
Regards,
 
Upvote 0
THANK YOU anvg. You're right, there's no weekstart function. Your suggestion is perfect. Here's what I ended up with:

Code:
Date.StartOfWeek(([Ship Date]), Day.Saturday))
 
Upvote 0

Forum statistics

Threads
1,224,144
Messages
6,176,647
Members
452,739
Latest member
SCEducator

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