MongoDB has become a common choice for modern applications because of its flexible, document-based schema and ability to scale quickly. At the same time, business teams increasingly rely on Power BI for dashboards, operational reporting, and executive analytics.
Connecting these two systems allows organizations to turn operational application data into actionable insights. However, the integration is not always straightforward. MongoDB stores data in JSON-like documents, often with nested structures, while Power BI expects structured tables.
A modern connector layer solves this challenge by exposing MongoDB data through a SQL-compatible interface that Power BI can query directly. Platforms like CData Connect AI provide secure, real-time connectivity without complex ETL pipelines or custom scripting, enabling teams to analyze MongoDB data in Power BI within minutes.
Choose the best connection method for your environment
MongoDB's own Connector for Business Intelligence, for both Atlas and on-premises, reaches end-of-life after September 2026 and will no longer be supported. For organizations running self-managed MongoDB or hybrid infrastructure, the EOL leaves a gap: the tool you relied on for Power BI connectivity is going away, and MongoDB's replacement doesn't cover your deployment model.
Several approaches exist for a Power BI and MongoDB integration. The right option depends on your infrastructure, governance requirements, and level of technical resources, but the September 2026 deadline makes this decision more urgent for teams still relying on MongoDB's native BI Connector.
Here’s a brief overview of some approaches:
Method | Deployment | Advantages | Considerations |
MongoDB Atlas SQL Interface | Cloud | Native integration for Atlas deployments | Limited to Atlas environments |
CData Connect AI | Cloud / Hybrid / On-prem | No-code connectivity platform, SQL-92 support, metadata discovery, real-time queries | Requires connector platform |
ODBC/JDBC Drivers | Desktop / Server | Flexible and widely supported | Manual setup and configuration |
Python ETL Pipelines | Self-hosted | Full customization | Requires coding and maintenance |
Secure your MongoDB data source
Before Power BI queries MongoDB, organizations must verify that the data environment meets their security and compliance requirements, especially if this connection will serve dashboards across multiple teams or feed into production reporting.
Security begins with the connection itself: TLS encryption protects data in transit, IP allowlists or private endpoints control which networks can reach the database, and multi-factor authentication covers administrative accounts. On the MongoDB side, scope access so the credentials Power BI uses only reach the collections and fields that reporting requires. A dedicated read-only user for Power BI is a straightforward way to keep the analytical connection open without exposing write operations that can affect production datasets.
For ongoing governance, complete audit logging and encryption while at rest give you a record of what was accessed and confidence that stored data is protected. Teams running MongoDB at scale often layer in monitoring through Datadog or PagerDuty to catch latency spikes or unusual query patterns before they affect downstream dashboards.
Install and configure the required connectors
The process of setting up a connection depends on whether you use a managed connector platform or a traditional driver-based approach. Both get Power BI connected to MongoDB, but the difference is where the configuration burden sits and how much of it you carry forward.
CData Connect AI handles the connection as a managed layer. You add MongoDB as a data source, provide your connection details and CData discovers the schema automatically, mapping collections and nested structures into relational tables that Power BI can query directly. From there, Power BI connects through the platform's endpoint and you're working with data. Because CData resolves schema discovery and metadata caching at the platform level, you don't rebuild this work when MongoDB collections change, or new fields appear, the connection adapts as your MongoDB does.
ODBC driver setups follow a more traditional, manual path. Power BI Desktop connects to MongoDB through ODBC by creating an ODBC DSN, which is a stored configuration entry that holds your driver type, server address, and credentials so they don't need to be re-entered each session. Once the ODBC DSN is configured, you connect from Power BI using Get Data > ODBC, select the ODBC DSN, and choose your collections. This works, but schema mapping is manual: you define how MongoDB's document structures translate into tables, and any changes to your MongoDB schema mean revisiting that configuration. For teams managing multiple data sources or frequent schema changes, that maintenance compounds over time.
Discover and prepare MongoDB data for Power BI
MongoDB documents aren't static. Collections evolve as applications add or adjust fields, nest new objects, or change array structures. A schema discovered at configuration doesn't guarantee that every query will return clean, tabular results. The connector needs to handle structural variation on every request.
CData manages this at the data layer. When Power BI sends a query, CData evaluates the current structure of the target collection, flattens nested objects into columns, and resolves arrays into related tables or inline structures, all before results reach Power BI. It happens during query execution, which means the relational view that Power BI works with will always reflect MongoDB's current state.
Without a managed connector, the flattening work falls to your data engineering team. The most common path is Python ETL, where teams using Pandas can utilize json_normalize() to expand nested documents into flat columns and df.explode() to unpack array fields into individual rows , then export to CSV or load directly into Power BI. For more complex document structures, schema modeling tools like Hackolade can help you plan stable, tabular views from MongoDB collections before building the transformation. Either way, the logic lives in code or tooling that your team maintains as schemas evolve.
This matters because the alternative of writing and maintaining transformation scripts or building intermediate staging pipelines creates a second system to manage. Every schema change in MongoDB requires a corresponding update to the transformation logic. CData eliminates that dependency by resolving structure at query time, so analysts work with current data in a consistent tabular format without maintaining a parallel transformation layer.
Select the optimal data mode: Import or DirectQuery
Power BI offers two modes of connection for data sources, Import and DirectQuery. When looking to visualize data in Power BI, it is important to understand the differences in these connectivity modes to choose the best option for the use case:
Import: Power BI loads data into the model and caches it to create a point-in-time snapshot of the data
DirectQuery: Power BI queries the data source directly at run-time, rather than using a cached dataset.
DirectQuery vs Import mode in Power BI
| Freshness | Transformations | Refresh Requirements | Data Size | Schema Changes |
DirectQuery | Data is always queried live | Limited modeling | None, data is always live | No restrictions | Changes to the source data are automatically reflected |
Import | Data is imported and cached; freshness is based on the refresh schedule | Full modeling capabilities with Power Query | Scheduled or on-demand refresh | Limit of 1 GB | Data is cached, requiring a full refresh to reflect changes |
Test and optimize performance and security
A working connection is just the starting point for the integration, not the finish line. Before dashboards go into production, the integration needs to be validated for performance, correctness, and governance.
Sample queries that mirror actual reporting patterns, the joins, filters, and aggregations Power BI dashboards will execute in production, reveal how the connection behaves under realistic conditions. Latency and performance matter, but so does correctness. Results in Power BI should match what a direct MongoDB query returns. Discrepancies at this stage usually point to schema mapping issues or filters not being pushed down to the source.
The largest performance optimizations happen in MongoDB itself. Indexing the fields that dashboards filter and sort on most frequently prevents queries that feel fast during testing from degrading as data volumes grow. On the Power BI side, limiting projected columns to what each visual requires and structuring filters so they can be pushed down to MongoDB reduces data transfer significantly. CData Connect AI has a pushdown engine that evaluates each query and executes what it can at the source automatically, but well-structured queries give it more to work with.
Governance validation should cover the full path before moving to production. Role-based access controls need to enforce the right permissions, encryption should be active in transit and at rest, and audit logging should capture query activity at a level that satisfies compliance requirements. Monitoring cluster operations, connection counts, and IOPS, through MongoDB's built-in metrics or alerting integrations, ensures that performance degradation or unusual access patterns are seen before they reach production dashboards.
Connect Power BI Service with gateways for automated refresh
Power BI dashboards hosted in the Power BI Service often require automated refresh from MongoDB. A Power BI Gateway acts as a secure bridge between data sources that aren't directly exposed to the internet and the Power BI cloud service. It handles scheduled and on-demand refresh requests, routing queries through the gateway to MongoDB and returning results without opening the database to public access.
The setup typically involves:
Installing the gateway on a host within the same network as the MongoDB instance
Registering the gateway with Power BI Service
Configuring the MongoDB data source within the gateway
Setting refresh policies, scheduled intervals for periodic reporting, or change data capture for near-live dashboards that track operational state
With CData Connect AI, no gateway is needed. Power BI Service connects directly to Connect AI, which handles schema resolution, authentication, and query optimization as a managed layer. Refresh schedules are configured within Power BI Service the same way they would be for any cloud data source, no local infrastructure to install, register, or maintain.
Frequently asked questions
How do I secure the connection between MongoDB and Power BI?
Use TLS encryption, role-based access controls, and network restrictions such as IP allowlists or private endpoints. Create a read-only database user specifically for Power BI to reduce security risk.
What is the difference between Import mode and DirectQuery in Power BI?
Import mode loads a snapshot of your MongoDB data into Power BI for fast analysis. DirectQuery keeps reports connected to live data, allowing real-time dashboards without copying the entire dataset.
Can I connect Power BI to self-hosted MongoDB without coding?
Yes. A no-code connector such as CData allows Power BI to query self-hosted MongoDB environments through a simple configuration process rather than custom scripts or ETL pipelines.
How do I handle nested documents and arrays from MongoDB in Power BI?
Use a connector that supports schema discovery and automatic flattening. This converts nested JSON structures into relational tables and columns that Power BI can visualize.
What are best practices for optimizing MongoDB queries in Power BI?
Limit columns returned in queries, apply filters at the source database, and ensure indexes exist for frequently queried fields to improve performance.
Connect MongoDB to Power BI with CData Connect AI
CData Connect AI delivers live, governed MongoDB data to Power BI — resolving nested document structures into relational tables without gateways, transformation scripts, or manual schema mapping. Connect with passthrough security, automatic metadata discovery, and DirectQuery access, all from your browser.
Try Connect AI free and experience how fast secure analytics can be.
CData Connect AI today
See how Connect AI excels at streamlining AI and business processes for real-time insights.
Get the trial