Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Convert year and ISO week number into date

Hello,

I have the following table and i am trying to create a relationship between this table and my calendar table. Is it possible to convert the combination of year and ISO week number into a date? If yes, how to proceed? Any help is much appreciated!

 

YearISO Week numberItemsReturnsDefective
202045615
202173313
202283314
202282717
20224228
202136918
20222349
2021103720
202267821
202232510
202039315
202276316
  • Hi Anonymous ,

     

    How about this:

     

    I assumed you would like to get the first day of the respective week in date format. 

    I took inspiration from here.

     

    Here the code for the custom column:

    Date.From(Number.From(Date.AddDays(Date.FromText("1/1/"&Number.ToText([Year])),-3))-Date.DayOfWeek(Date.FromText("1/3/"&Number.ToText([Year])))-1+[ISO Week number]*7)

     

    Let me know if this helps 🙂

     

    /Tom
    https://www.tackytech.blog/
    https://www.instagram.com/tackytechtom/

1 Reply

  • tackytechtom's avatar
    tackytechtom
    Most Valuable Professional

    Hi Anonymous ,

     

    How about this:

     

    I assumed you would like to get the first day of the respective week in date format. 

    I took inspiration from here.

     

    Here the code for the custom column:

    Date.From(Number.From(Date.AddDays(Date.FromText("1/1/"&Number.ToText([Year])),-3))-Date.DayOfWeek(Date.FromText("1/3/"&Number.ToText([Year])))-1+[ISO Week number]*7)

     

    Let me know if this helps 🙂

     

    /Tom
    https://www.tackytech.blog/
    https://www.instagram.com/tackytechtom/