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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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