Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

How to convert Milliseconds into a DateTime format?

I currently have a table of stored API data. Below I'm showing one seperate column with a few example rows that contain 13 digit Millisecond timestamps. How would I convert this into a DateTime format? Or just any readable Time or Date format that makes it look nice. Even if it's creating a custom column that transforms the data which I have tried to do but I've had no success. 

Any help would be appreciated. 

Created
1592397519540
1592401918076
1592412872330

6 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you PhilipTreacy 

      This works! I appreciate you going through it in simple detail for me. 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello PC2790 

      Thanks for the suggestion, I did already go through that answer and the "Measure" wasn't recognised, neither was "DATEVALUE" when I tried to create a custom column of [Created] data. 

       

       

  • Hi Anonymous 

    Measures are written in the DAX language and need to be created from within the Data view of PBI Desktop.

    From your screenshot it looks like you are writing the DAX in the Power Query editor but this only accepts the M language.

    Regards

    Phil

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you PhilipTreacy , I got confused. I'm currently creating a new measurement however, I can't direct it to just one column. 

      Measure = DATEVALUE("1970-1-1") + ('Created' /(60*60*24*1000))

      On here the 'Created' part is asking for the table instead of the column. How do I make it specific for the 'Created' column?