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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Power bi reading date incorrectly from msSQL table/Wrong date column

Hi all,

 

I have been trying to import data directly from MSSQL to the query editor, however, the date/time columns are showing strange numbers (i.e. 1.45985E+12) and when I try to change the data format to Data/time or Time I get an error! 

 

Does anyone have an idea of things that I can apply that might help me? 

 

5 REPLIES 5
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous,

 

which application does the table belong to?

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Anonymous
Not applicable

Hey @mwegener,

 

I am using import mode to connect to msSQL tables for Manage Engine Service Desk Plus.

 

 

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous ,

I think the program works with a UNIX timestamp.

 

Look at this.

https://stackoverflow.com/questions/2904256/how-can-i-convert-bigint-unix-timestamp-to-datetime-in-sql-server

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Anonymous
Not applicable

Hi @mwegener

 

Please excuse my limited knowledge in SQL - I checked from the sql server and the data type is bigint however I have been trying since yesterday to add the below code in my advanced editor in the query editor but I keep getting errors.

 

This is the code to add:

 

Select dateadd(S, [unixtime], '1970-01-01') From [Table]

 

And this is my original code from the server:

 

let
Source = Sql.Database("XXXXXX\MANAGEENGINE", "servicedesk"),
dbo_WorkOrder = Source{[Schema="dbo",Item="WorkOrder"]}[Data]

in
dbo_WorkOrder

 

Can you please advise? 

 

 

tex628
Community Champion
Community Champion

Try adding a custom column with something like this; 

 

Date.AddDays(#date(1970, 1, 1), [unixtime]/60/60/24)


To my knowledge there is no dateadd which allows you to add seconds in powerquery... 😞

Br,
J

 


Connect on LinkedIn

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.