Forum Discussion
OLE DB or ODBC error: type mismatch (exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
Sorry to hear that. You could open a ticket, but here are a few suggestions.
Run the refresh in PowerBI.com - it will fail, but the error reporting is better (? why ? I don't know) - so if you look at the dataset in the "schedule refresh" area, you will see the failure notification - if you expand that, it may identify the column that is causing the problem. Then you step through your query (and rebuild it if necessary).
If that error does not show, go to PowerBI desktop and get into the data view - then look at the fields list and start by inspecting any columns that are flagged, then look for items that are have date format. Hypotheis is that a new value showed up in your data that caused PowerBI to "change it's mind" about the TYPE - moving from Text or Date Type to "any" or "text".
May need to rebuild those.
I do not think this was a matter of someone changing the format in the source - so the cause of the problem is not known - one day it was working, the next it was not - so I would not advise going down that path as a first step - unless you control everything and have easy access.
Good luck.
Just had the same error and solved it by duplicating my table in the Query Editor, deleting the original table and renaming the copy to the original's name.. Hope that helps
- mruta8 years agoNew Member
It just worked !!! Thank you :)
- pineapple778 years agoFrequent Visitor
Hi, there,
This happened to me also. But i figured out that if i remove all the relations to the table it will be better to do changes on it.
When I removed the relations and edited the table (without duplicating it and etc.), all the changes were applied without any problems.
I think it is because you have some "strange" values in a column or columns that are in relation to others and from there it reffers to that TYPE MISMATCH.
It worked for me.
Have a nice day!
Pavlin
- jocy8 years agoFrequent Visitor
It worked, thank you very much...only problem is that I lost all the measures I inserted in that table :(
Now I'm copying the formulas from my older .pbix, but this is really problematic, I hope this gets fixed soon by PBI Team, considering that in June 2018 is still happening.Thank you again chabib :)
- jocy8 years agoFrequent Visitor
It worked thank you very much!
Too bad I had to copy all my old measures again and change the origin of the dependant queries, but it helped a lot :)
- KH11NDR7 years agoHelper IV
A date field was giving me probs, it loaded from SQL as text, so I changed it to Decimal number and then then tried to create a Date field, But I still got that message, so I left it as a Decimal number and created four seperate columns, Year, Month, Day and then concateated them together and the query reloads without the error. Hope that helps someone.
- gDae7 years agoNew Member
It didn“t help. I just lost all my charts and need to start building from scratch! :smileysad:
- gDae7 years agoNew Member
It did not help. I lost my charts in the process because they were built on the original.
- Anonymous6 years agoNot applicable
Thank you very much.
- Anonymous5 years agoNot applicable
This works for me, thanks!
- Syndicate_Admin4 years agoAdministrator
I had a similar fix as KH11NDR. I also was using SQL as my data source and pasting in my SQL in the advanced editor to add fields. I thought I would save time reformatting in PBI by formatting currency in my SQL and also formatting dates mm/dd/yyyy in SQL using just format without convert (ie. convert(date, format(Data_field, 'd', 'en-us')); however, this caused PBI on load to mis-categorize the fields as text instead of currency or date. To fix the error, I had to remove the formatting in SQL and reformat these fields in PBI after loading. Hopefully this info helps others who might run across similar instance.