Forum Discussion
How to create date from week and year colums in powerquery?
- 1 year ago
Hi sylvianelissen,
I realise Fowmy just replied, but just adding an option I had been looking at.
If you are using ISO Weeks, you would need to implement something like this:
In Power Query, you could create a function to do the conversion:
//fn_YearWeeknumToWeekStartDate (Year as number, #"Week Number" as number) as date => let Jan01 = #date(Year, 1, 1), Jan03 = #date(Year, 1, 3), Jan03_DayOfWeek = Date.DayOfWeek(Jan03, Day.Sunday), WeekStartDate = Date.AddDays(Jan01, - Jan03_DayOfWeek + #"Week Number" * 7 - 4) in WeekStartDateBelow is a sample query to test the above function:
let Source = #table( type table [Jaar = Int64.Type, Weeknummer = Int64.Type], {{2025, 1}, {2025, 2}, {2025, 3}, {2025, 4}} ), #"Added Week Start Date" = Table.AddColumn( Source, "Week Start Date", each fn_YearWeeknumToWeekStartDate([Jaar], [Weeknummer]), type date ) in #"Added Week Start Date"
Hi sylvianelissen
I wanted to follow up since I haven't heard from you in a while. Have you had a chance to try the suggested solutions?
If your issue is resolved, please consider marking the post as solved. However, if you're still facing challenges, feel free to share the details, and we'll be happy to assist you further.
Looking forward to your response!
If the above information helps you, please give us a Kudos and marked the Accept as a solution.
Best Regards,
Community Support Team _ C Srikanth.