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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
StuartSmith
Power Participant
Power Participant

OLE DB or ODBC error: Exception from HRESULT: 0x80040E1D - Due to Whole Number to Date type change.

All, am working with an Excel file that has a column containing dates with custom formatting "mmmm yy".  When its imported into Power Bi, the date column is imported as "Whole Number" type and therefore I change the data type to "Date" and this updated the column to show the date and not a whole number.  But once thats been done, upon a refresh, the below error happens. I have checked the version of Bi I am running and its the current one, plus tried enabling\disabling "Auto Date\Time" in options.

 

Any Ideas?

 

2020-09-09_09-15-59.jpg

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@StuartSmith , Check data loaded there should some row having a problem.

Check does show row error in any row.

My suggestion would me create a date using this column instead of changing the type .

 

refer how to handle error in power query
https://www.youtube.com/watch?v=OE6DPmKqN7s
https://www.youtube.com/watch?v=9-Lag0VOiTs

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@StuartSmith , Check data loaded there should some row having a problem.

Check does show row error in any row.

My suggestion would me create a date using this column instead of changing the type .

 

refer how to handle error in power query
https://www.youtube.com/watch?v=OE6DPmKqN7s
https://www.youtube.com/watch?v=9-Lag0VOiTs

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

When yu say check data load, do you mean here?

 

2020-09-09_09-57-07.jpg

and your comment about creating a a new "Date" column, do you mean create a new column by converting the whole number into a date?  if so, do you know what the correct DAX would be? to create the new column?

 

Thanks in advance,

@StuartSmith , refer this month year to date can help you

https://youtu.be/cJqgphIHXz8

 

Also, can you share the same data, which is creating the problem in text format

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

ok, figured it out. I created a new column using...

 

Invoice Date = SpendbyVendorRegionVendorCoun[Explicit Invoice Ymv]
 
and then converted to date type.  Refreshed the data and more errors.
 
I suspect there might be a more refined way to convert to date within the code.
 
 
StuartSmith
Power Participant
Power Participant

UPDATE: I have found that if i import the excel file with the original date column name it causes the error, but if i change the date column name to "Date" and then import, it works fine.

 

Imported excel file with date column name unchanged.

2020-09-09_09-41-47.jpg  

 

Imported excel file with date column name changed to "Date" and it works.

2020-09-09_09-43-00.jpg

 

Obviously, i no longer get the error, but means I would have to update the column name of the excel file that contains the date everytime a fresh data set is available.  Any ideas why this is happening and how to fix without having to rename the excel column.

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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