Forum Discussion

Rapaille's avatar
Rapaille
Helper I
1 year ago
Solved

Date based on year and week

Hello all,   In Power BI Power Query I want to create a date table. The end day is today and my startday should be the date of the calculated Monday of the week and year columns.    Can someone h...
  • AmiraBedh's avatar
    1 year ago

    For StartDate, go to the "Add Column" tab and select "Custom Column" :

     

    Date.AddDays(Date.FromText(Text.From([Year]) & "-01-01"), (([Week] - 1) * 7) - Date.DayOfWeek(Date.FromText(Text.From([Year]) & "-01-01"))

     

     

    and for the Enddate :

     

    DateTime.Date(DateTime.LocalNow())

    If you can provide some data, it will be helpful 🙂