cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bokbob Regular Visitor
Regular Visitor

Converting UNIX time to Date in PowerBI for Desktop

Hi, i am having issues converting the time in Unix time (60*60*24) to date time.

 

i tired http://stackoverflow.com/questions/35650485/how-to-convert-unix-time-to-date-in-powerbi-for-desktop

 

and https://community.powerbi.com/t5/Integrations-with-Files-and/Converting-Unix-timestamp-from-Stripe-A...

 

but i couldnt get it to work. i have the values like the attached in first picture. Please help me convert this number to datetime.Capture.PNG

 

 

Capture-2.PNG

 

 

Capture-3.PNG

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator Eric_Zhang
Moderator

Re: Converting UNIX time to Date in PowerBI for Desktop

@Bokbob

You can add a custom column

#datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [UnixTime]/1000)

Capture.PNG

7 REPLIES 7
Moderator Eric_Zhang
Moderator

Re: Converting UNIX time to Date in PowerBI for Desktop

@Bokbob

You can add a custom column

#datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [UnixTime]/1000)

Capture.PNG

caito103 Regular Visitor
Regular Visitor

Re: Converting UNIX time to Date in PowerBI for Desktop

Hey!

And how can i apply this formula but with a specified Time Zone?

 

Thank you!

migue7899 Frequent Visitor
Frequent Visitor

Re: Converting UNIX time to Date in PowerBI for Desktop

hi 

 

I have the same problem my time zone is gmt -6?

migue7899 Frequent Visitor
Frequent Visitor

Re: Converting UNIX time to Date in PowerBI for Desktop

hi 

 

I have the same problem my time zone is gmt -6?

Highlighted
Super User
Super User

Re: Converting UNIX time to Date in PowerBI for Desktop

Adjust the formula with -6 as hours in the #duration part:

 

#datetime(1970, 1, 1, 0, 0, 0) + #duration(0, -6, 0, [UnixTime]/1000)

 

Specializing in Power Query Formula Language (M)
DaviDamasceno New Member
New Member

Re: Converting UNIX time to Date in PowerBI for Desktop

Hi i make this video to explain

 

https://youtu.be/3N27eS2oJmA

 

Smiley Very Happy

jpwilkinson New Member
New Member

Re: Converting UNIX time to Date in PowerBI for Desktop

Thanks for the post, i got it to work for my data.  Only one point was that the unit time I had was unix time in s not ms, so I didn't need the /1000.  I think unix time is quite common in both formats.