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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
neetu14
Employee
Employee

Type mismatch - Unable to convert a value to the data type requested

Getting datatype mismatch error when refreshing the report on Power BI Service.

datatype in SQL source table is nvarchar whereas in power bi desktop it is a decimal number (which is what I need for the report)

And I do not have permission to change datatype in the source table.

 

Is there a way to somehow create a new column with desired data type and copy values from existing source column to new one and let power bi desktop convert the data type before publishing the report?

 

Processing error:The current operation was cancelled because another operation in the transaction failed. The following system error occurred: Type mismatch. Unable to convert a value to the data type requested for table 'AAS_Processing' column 'Avg_ProcessingTimes'. The data provider was unable to convert the value '<pii>NaN</pii>' from the source data type 'VT_BSTR' to the expected data type 'VT_R8'. Please check the column data types in the data model and data source and ensure that the data types are compatible.

 

1 ACCEPTED SOLUTION

Sure, right-click the colum and use Replace Values. In Query Editor.

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
CN1
Regular Visitor

Hi there 🙂

 

I have the same issue, but I'm not finding the "wrong value" to replace.

 

Erro de processamento: The following system error occurred:  Type mismatch.  Unable to convert a value to the data type requested for table 'Metas 2022' column 'Mês do Ano'. The data provider was unable to convert the value '' from the source data type 'VT_BSTR' to the expected data type 'VT_DATE'. Please check the column data types in the data model and data source and ensure that the data types are compatible.

 

What's the value '' ?

There's no blank values on table 😕 can you help please?

 

There are the related tables on desktop:

 

CN1_2-1663865318339.png

CN1_3-1663865340045.pngCN1_4-1663865356252.png

 

And there's the source of "Metas 2022":

CN1_5-1663865579302.png

 

Can you help?

Thank you.

Greg_Deckler
Super User
Super User

Can you leave it as text in the query and then in the Desktop (not Query Editor), change the Data Type of the column?

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

I tried that and published the report, got the same error.

 

Is there any way to convert the data type in desktop instead of sql source?

 

Wait, I read the error message a little better. Try filtering out "<pii>NaN</pii>" in that column in Query Editor. It looks like there are some rows that have "<pii>NaN</pii>" in them for that column perhaps? It won't be able to convert that to a number so you will have to filter those out. Do this before any Change Type in Power Query where you try to change it to a decimal number.

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks for your reply. Is there a way to replace the 'NAN' value with 0 for future records?

 

For example, what if the data being refreshed tomorrow has the same value, can it be automatically replaced with 0 and report is refreshed without any issues.

 

Sure, right-click the colum and use Replace Values. In Query Editor.

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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