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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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