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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.