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
It's been a while since I heard back from you and I wanted to follow up. Have you had a chance to try the solutions that have been offered?
If the issue has been resolved, can you mark the post as resolved? If you're still experiencing challenges, please feel free to let us know and we'll be happy to continue to help!
Looking forward to your reply!
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.