Change All Dates To Fridays in a Fri-Thu Week in Power Query

ExcelAtEverything

Active Member
Joined
Jan 30, 2021
Messages
351
Office Version
  1. 2019
Platform
  1. Windows
Hello,
I was wondering if anyone could help me with what is probably a very simple tweak. This currently takes a copy of my date column and changes all the dates to Sunday's date of whatever week that is.
The trouble is that my weeks run Fri-Thu, so I need it to show the date of the Friday at the start of each week, not Sunday..
Thx for any help!

Power Query:
= Table.TransformColumns(#"Duplicated Column",{{"Date - Copy", Date.StartOfWeek, type date}})
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Power Query:
= Table.TransformColumns(#"Duplicated Column",{{"Date - Copy", each Date.StartOfWeek(_, Day.Friday), type date}})
 
Upvote 0
Power Query:
= Table.TransformColumns(#"Duplicated Column",{{"Date - Copy", each Date.StartOfWeek(_, Day.Friday), type date}})
I'm going to try coy/pasting it in and see, but this looks identical to what I was trying which is why I was confused when it didn't work. Maybe I had a character off or something. I'll try again and report back.
 
Upvote 0
I'm going to try coy/pasting it in and see, but this looks identical to what I was trying which is why I was confused when it didn't work. Maybe I had a character off or something. I'll try again and report back.
Any update on this?
 
Upvote 0
It works for me (XL2016). What exactly is happening for you?
 
Upvote 0
Sorry it took me so long. I moved on to other work & by the time I got back to this, I redesigned a few things which changed my needs. Finally today I made some time to check back in here & came across my post like "oh yeah", but unfortunately I already changed my sheet. RoryA, should I just assume it works and mark complete? Or should I wait for someone to confirm it works and then mark as complete?
 
Upvote 0
The formula given by @JGordon11 is different then yours, and indeed works.
Look at the extra argument in the formula that indicates first day of week as Friday.
Power Query:
Day.Friday
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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