Forum Discussion
slohombre
Aug 17, 2020Brass Contributor
Power Query Date Extrapolation
 Hi, all. Looking for some advice on how to extrapolate a date from two columns of information. I have a column that has week of year number (1,2,3,4, etc.) AND I have another column that has day name...
SergeiBaklan
Aug 20, 2020Diamond Contributor
For such sample
you may do it with query
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Added Custom1" = Table.AddColumn(Source,
        "Date",
        each
            Date.AddDays(
                Date.StartOfWeek(
                    Date.AddWeeks(
                        #date(2020, 1, 1),
                        [Week Number]-1
                    ),
                    Day.Monday
                ),
                List.PositionOf(
                    {"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"},
                    [Day]
                )
            )
    )
in
    #"Added Custom1"but it very depends on which standard do you use for first week of the year and from which day week starts (here is from Monday).