Forum Discussion

kelly49's avatar
kelly49
Frequent Visitor
9 years ago
Solved

Convert YYYYWW from string to date for time series functions

My sales data comes in a string format of YYYYWW and I need to fix it for time series calculations.     I was able to convert it in SQL to the first day of the week beginning on January 1, but 2016...
  • v-chuncz-msft's avatar
    v-chuncz-msft
    9 years ago

    kelly49,

     

    You may use DAX below to add a calculated column.

    WeekEndDate =
    DATE ( VALUE ( LEFT ( Table1[YYYYWW], 4 ) ), 1, 1 )
        + VALUE ( RIGHT ( Table1[YYYYWW], 2 ) ) * 7
        - 1