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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
jburrelli
Frequent Visitor

How do I convert a $date (an isolate field in mongo) into a readable timestamp?

Online I have a readable timestamp in the data explorer but when I load the data I get a timestamp that is not readable. For example, I get 1.55723E+12

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @jburrelli ,

 

When the data is load into the Power BI Desktop, it may change the data type automatically. So try to find the query step named "Change Type" in Query Editor, delete this step, and try it again. If your timestamps is like "1490787085874", and you need convert it to date type, then you can try this code.

 

UTCTime = VAR date = [timestamps ]/(60*60*24*1000) RETURN (DATEVALUE("1/1/1970")+date)

 

7.png

 

 

 

 

 

 

 

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xicai
Community Support
Community Support

Hi @jburrelli ,

 

When the data is load into the Power BI Desktop, it may change the data type automatically. So try to find the query step named "Change Type" in Query Editor, delete this step, and try it again. If your timestamps is like "1490787085874", and you need convert it to date type, then you can try this code.

 

UTCTime = VAR date = [timestamps ]/(60*60*24*1000) RETURN (DATEVALUE("1/1/1970")+date)

 

7.png

 

 

 

 

 

 

 

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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