Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

convert string to datetime

Hi, I have a table like this : I need to convert the string to a datetime . The row 52 should be 06/09/2020 01:00:00, row 53 = 06/09/2020 02:00:00. So I can plot a series time by hour base...
  • ryan_mayu's avatar
    3 years ago

    Anonymous 

    you can try this

    Column = 
    VAR _date=date(left('Table'[hourofday],4),mid('Table'[hourofday],5,2),mid('Table'[hourofday],7,2))
    VAR _time=time(right('Table'[hourofday],2),0,0)
    return _date+_time

  • ryan_mayu's avatar
    ryan_mayu
    3 years ago

    you are welcome