March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Please help with this issue.
I encountered an error while loading some tables into Power BI. The error message is:
"Failed to save modifications to the server. The error returned: 'OLE DB or ODBC error: [DataSource.Error] ODBC: ERROR [22018] [MongoDB][API] invalid character value for cast to type: Bit.'"
This error indicates that there is an issue with casting a character value to a Bit data type in the MongoDB API.
Solved! Go to Solution.
Hi @Wani_Muneer,
According to your error messages, I'd like to suggest you take a look at the following options if suitable for your requirement.
1. Data Type Mismatch: The error message mentions that a value in your MongoDB data may be incompatible with the expected data type (e.g., convert a non-numeric value to a numeric type).
Check the data types of the fields in your MongoDB collection to ensure that they align with the expected data types in your Power BI model.
2. Bit Data Type Issue: The specific mention of “Bit” in the error message indicates that there might be an issue with handling Boolean (true/false) values.
Verify if any Boolean fields (such as flags or indicators) in your MongoDB data are causing the problem. If you have Boolean fields, ensure that they are correctly represented in your MongoDB collection.
3. Special Characters or Encoding: MongoDB data may contain special characters (e.g., non-ASCII characters, control characters) that cause issues during data conversion.
Check if any field values contain unusual characters or need proper encoding. Consider cleaning or transforming the data before importing it into Power BI.
4. ODBC Driver Configuration: The ODBC driver acts as a bridge between MongoDB and Power BI.
Confirm that you have installed the correct MongoDB ODBC driver (matching your Power BI version and bit version) and configured it properly. Please also double-check the connection settings, including authentication details and server address.
Regards,
Xiaoxin Sheng
Hi @Wani_Muneer ,
Can you please share some more detail information about this issue? They should help us clarify your scenario and test to troubleshoot.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hi v-shex-msft
I'm currently working on fetching data from MongoDB database and transforming it for use in Power BI. However, I encountered some errors during the table loading process.
Hi @Wani_Muneer,
According to your error messages, I'd like to suggest you take a look at the following options if suitable for your requirement.
1. Data Type Mismatch: The error message mentions that a value in your MongoDB data may be incompatible with the expected data type (e.g., convert a non-numeric value to a numeric type).
Check the data types of the fields in your MongoDB collection to ensure that they align with the expected data types in your Power BI model.
2. Bit Data Type Issue: The specific mention of “Bit” in the error message indicates that there might be an issue with handling Boolean (true/false) values.
Verify if any Boolean fields (such as flags or indicators) in your MongoDB data are causing the problem. If you have Boolean fields, ensure that they are correctly represented in your MongoDB collection.
3. Special Characters or Encoding: MongoDB data may contain special characters (e.g., non-ASCII characters, control characters) that cause issues during data conversion.
Check if any field values contain unusual characters or need proper encoding. Consider cleaning or transforming the data before importing it into Power BI.
4. ODBC Driver Configuration: The ODBC driver acts as a bridge between MongoDB and Power BI.
Confirm that you have installed the correct MongoDB ODBC driver (matching your Power BI version and bit version) and configured it properly. Please also double-check the connection settings, including authentication details and server address.
Regards,
Xiaoxin Sheng
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
86 | |
77 | |
57 | |
52 |
User | Count |
---|---|
201 | |
137 | |
108 | |
73 | |
68 |