date conversion
1 TopicConvert date format 'YYww' to FirstDateOfWeek
Hello, I have a column with data containing the last two digits of a year and a two digit week number. I would like to add a new column called FirstDateOfWeek where the first date of the specified week. Example: 2207 should convert to 2022-02-18 I have tried this code that I got from ChatGPT, but it does not work. Date.From(Date.From(DateTime.FromText("20" & Text.From([YearWeek], "00-00"), "yyyy-MM-dd")) - Duration.From(Duration.FromDays(Date.DayOfWeek(Date.From(DateTime.FromText("20" & Text.From([YearWeek], "00-00"), "yyyy-MM-dd")) - #datetime(2000, 12, 31, 0, 0, 0)) + Number.FromText("00-01")))Solved3.8KViews0likes3Comments