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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.