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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Remahl_M
New Member

Power BI unable to read time portion of MongoDB date format

I am currently using Version: 2.61.5192.601 64-bit (August 2018). We are using the ODBC connector to connect to a MongoDB deployment.

 

I can confirm that date with time is saved correctly in the MongoDB database:

 

MongoDB_time_example.png

 

 

 

 

 

However in Power BI/ Query Editor, all the time values are defaulting to "00:00:00" even when changing type to Date/Time.

If we try to change type to just "Time" we get an 'Error'.

 

QueryEditor_changetype_fail.png

 

 

 

 

 

 

 

 

 

 

 

Can't seem to find a way to get around this via Advanced Editor or Query Editor. A search for solutions showed one thread from 2017 with a solution/workaround that I have tried and does not work: Link here.

 

I requested to my colleague if we could create a seperate column with just time data in MongoDB but I was advised that there is no "Time" data type. MongoDB saves both Date and Time in the combined "Date" data type. 

 

So it looks like the fix needs to come from the Power BI side. Possibly the Advanced Editor as the time data is already lost by the time I can work with it in Query Editor.

 

Does anyone have advice or has experienced the same issue when using MongoDB as a data source?

2 REPLIES 2
Stachu
Community Champion
Community Champion

I'd try splitting the column into separate date and time BEFORE changing the type. Then change appropiately for individual columns



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Thank you for your quick reply Stachu. Unfortunately your idea didn't work.

 

Split_column_fail.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The time still appears as "00:00:00". 

 

I went back into the steps to just after 'Navigation', usually the 2nd step. The "occurredon" column only showed a Date and when I split it out, what would have been the time column was "null".

 

 

***** 

 

EDIT: I started a brand new Power BI workbook and re-connected to just that specific table on MongoDB. I wanted to eliminate the possibility it might be just a one-off misconnection. But unfortuantely I still had the same problem. As far as PowerBI can tell, there is no timestamp accompanying that date value. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.