Forum Discussion
Power BI + MongoDB - Not seeing new fields
Hi All,
I currently have a PowerBI report connected to a MongoDB Cluster. I'm using a connection string like so:
DRIVER={MongoDB ODBC 1.4.5 Unicode Driver};Server=Power BI connector String;Port=27015/?ssl=true;authSource=admin;database=name;
The connection to the table and everything works fine.
The issue I'm having is that we added two new fields to the existing table in MongoDB and when I go to run a refresh in the report I do not see the new fields. I have tried clearing cache, resetting permissions, creating a new connection, etc. Nothing works.
Any thoughts?
In Power Query select "Refresh All" (not just "Refresh Preview") and then on Power BI select "Refresh Schema and Data".
Thankyou, lbendlin, for your response.
Hi jbrooks91,We appreciate your enquiry through the Microsoft Fabric Community Forum.
Based on my understanding, this issue arises because Power BI reads the schema exposed by the MongoDB BI Connector or ODBC driver, which uses sampling to infer the table structure. When new fields are added to MongoDB, they may not appear in Power BI if they were not included in the BI Connector’s sample or its cached schema.
Please follow the steps below, which may help to resolve the issue:
- As suggested by lbendlin, in Power Query click Home ->Refresh All. In Power BI Desktop, select Home ->Refresh ->Schema and Data.
- If the new fields still do not appear, run the following command on your MongoDB BI Connector or Atlas BI Connector to force re-sampling: FLUSH SAMPLE; or regenerate the schema using:
db.runCommand({ sqlGenerateSchema: 1, setSchemas: true }) - If you are using MongoDB Atlas BI Connector, navigate to Schema Sample Size under BI connectors in Clusters and increase the sample size (or set it to 0 to scan all documents), then refresh Power BI.
- Restart the BI Connector service and re-run Refresh (Schema and Data) in Power BI.
For further reference, please find the following links:
Data refresh in Power BI - Power BI | Microsoft Learn
Troubleshoot refresh scenarios - Power BI | Microsoft LearnWe hope the information provided helps to resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.
Thank you.
4 Replies
- lbendlin
Super User
In Power Query select "Refresh All" (not just "Refresh Preview") and then on Power BI select "Refresh Schema and Data".
- v-pnaroju-msft
Community Support
Thankyou, lbendlin, for your response.
Hi jbrooks91,We appreciate your enquiry through the Microsoft Fabric Community Forum.
Based on my understanding, this issue arises because Power BI reads the schema exposed by the MongoDB BI Connector or ODBC driver, which uses sampling to infer the table structure. When new fields are added to MongoDB, they may not appear in Power BI if they were not included in the BI Connector’s sample or its cached schema.
Please follow the steps below, which may help to resolve the issue:
- As suggested by lbendlin, in Power Query click Home ->Refresh All. In Power BI Desktop, select Home ->Refresh ->Schema and Data.
- If the new fields still do not appear, run the following command on your MongoDB BI Connector or Atlas BI Connector to force re-sampling: FLUSH SAMPLE; or regenerate the schema using:
db.runCommand({ sqlGenerateSchema: 1, setSchemas: true }) - If you are using MongoDB Atlas BI Connector, navigate to Schema Sample Size under BI connectors in Clusters and increase the sample size (or set it to 0 to scan all documents), then refresh Power BI.
- Restart the BI Connector service and re-run Refresh (Schema and Data) in Power BI.
For further reference, please find the following links:
Data refresh in Power BI - Power BI | Microsoft Learn
Troubleshoot refresh scenarios - Power BI | Microsoft LearnWe hope the information provided helps to resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.
Thank you.
- v-pnaroju-msft
Community Support
Hi jbrooks91,
We would like to follow up and see whether the details we shared have resolved your problem. If you need any more assistance, please feel free to connect with the Microsoft Fabric community.
Thank you. - v-pnaroju-msft
Community Support
Hi jbrooks91,
We are following up to see if what we shared solved your issue. If you need more support, please reach out to the Microsoft Fabric community.
Thank you.