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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Wani_Muneer
Helper I
Helper I

MOngodb to Powerbi Integration

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.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

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.

Wani_Muneer_0-1708699654407.png

 

 

Anonymous
Not applicable

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.