Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

14-digits Timestamp wrongly converted

Hi community!

 

I have been transforming some data in my Power query to create some reports that I need for the univeristy, but I'm struggling trying to convert and 14-digits timestam to datetime:

 

1. I have these kind of records:

jcrivera59_0-1625414743757.png

20170801000026, which basically is YYYY-MM-DD HH:MM:SS.

 

2. I created a new custom colum whith this custom formula: 

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

(https://community.powerbi.com/t5/Desktop/Converting-UNIX-time-to-Date-in-PowerBI-for-Desktop/m-p/130...)

jcrivera59_1-1625414881643.png

3. The new column is un datetime format, but in a weird way, because this is showing me a wrong date for every record:

jcrivera59_2-1625414963472.png

 

For example, in the previous example my original datestamp was 20170801000026 and a was expecting something like 2017-08-01 00:00:26 but system is showing me 2609-03-10T08:16:40.0260000.

 

Maybe I'm making some step wrong or I have a wrong column format but I tried multiple formats and I can't get the correct datetime.

 

I'll aprecciate if you can help me! Thanks in advance.

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

Add this custom column, you can do the formatting after loading the query to the model as you need

=Date.From(Text.Start([Timestamp],8))&Time.From(Text.End([Timestamp],6))

Fowmy_0-1625427852628.png

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

6 REPLIES 6
Syndicate_Admin
Administrator
Administrator

Awesome!!

collinsg
Super User
Super User

A quick way of doing this is to use DateTime.FromText. First change the type of the 14 digit timestamp to text. Then use the format option in the second argument of DateTime.FromText. The formats are described here.

 

= Table.AddColumn(
#"Name of Previous Step",
"Date & Time",
each DateTime.FromText( [14 Digit Timestamp], [Format="yyyyMMddHmmss"] ),
type datetime
)

collinsg_0-1684530624537.png

 

 

MattAllington
Community Champion
Community Champion

It doesn't look like Unix time to me. It looks like a surrogate DateTime key. Split the components of time into year, month, etc, then join back with the date and time functions. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Fowmy
Super User
Super User

@Anonymous 

Add this custom column, you can do the formatting after loading the query to the model as you need

=Date.From(Text.Start([Timestamp],8))&Time.From(Text.End([Timestamp],6))

Fowmy_0-1625427852628.png

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

It works perfectly my friend! Thank you so much! 😄

 

jcrivera59_0-1625436995505.png

 

Anonymous
Not applicable

I bet Column From Examples would work here.

--Nate

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.