Forum Discussion

dapperscavenger's avatar
6 years ago
Solved

Convert iso (wwyyyy) to date?

My report brings in the date format as ww.yyyy (e.g. 50.2019, 06.2020)   How can I convert this to a date format? (e.g. 09-12-2019, 05-02-2020)    
  • v-frfei-msft's avatar
    6 years ago

    Hi @dapperscavenger ,

    Please create a calculated column as shown below to work on it.

    Column = 
    VAR year =
        RIGHT ( 'Table'[wwyyyy], 4 )
    VAR weeknum =
        VALUE ( LEFT ( 'Table'[wwyyyy], 2 ) )
    VAR datetable =
        CALENDAR ( DATE ( year, 1, 1 ), DATE ( year, 12, 31 ) )
    RETURN
        MINX ( FILTER ( datetable, WEEKNUM ( [Date], 2 ) = weeknum ), [Date] )
    

    Capture.PNG

    Pbix as an attachment.