Skip to content
contact@sataware.com(480) 485-7373
PowerBIAgencyA division of Sataware Technologies Book a strategy call
Back
Document data

Power BI MongoDB integration that flattens documents properly

Power BI MongoDB integration means turning flexible documents into the rows and columns a report expects. Microsoft's connector list includes a MongoDB Atlas SQL connector, which reads Atlas data through a SQL interface. However, a self-hosted server follows a different route. In both cases, nested fields and arrays need careful flattening before any chart can show a correct total.

  • Atlas SQL connector
  • Arrays become tables
  • Schema checks on refresh

Last updated

How does Power BI MongoDB integration connect?

For MongoDB Atlas, Microsoft documents the MongoDB Atlas SQL connector. It needs a federated database instance in Atlas and the matching driver on the machine that runs the query. Then Power BI sees collections as tables through the SQL interface.

A server that you host yourself does not fit that connector. Instead, the honest options are an ODBC driver, an export to files, or a staging database that a small job fills. We pick among them by looking at volume and at who will maintain the result.

Either way, the connection is the easy half. The harder half is shape, because a document can hold lists inside lists. So most of our effort goes into deciding which tables the model needs.

Veins of a green leaf in close-up, illustrating Power BI MongoDB integration

Routes from MongoDB to a semantic model

Each route fits a different setup, so we compare them before choosing.

RouteFits whenWatch for
Atlas SQL connectorData lives in MongoDB AtlasFederated instance and driver setup
ODBC driverSelf-hosted server, modest volumeDriver also needed on the gateway
File exportOccasional or one-off analysisManual steps and stale data
Staging databaseLarge or complex documentsA load job to build and run
Data lake copyMany collections, long historyFolder rules and file formats

Why do nested documents cause wrong totals?

Take an order document with a list of line items. When a query expands that list, the order repeats once per line. Then a sum of the order total counts the same money several times.

The fix is modeling, not a formula trick. We split the document into an orders table and a line items table. After that, a relationship joins them, and each figure lives at its own level.

Loose schemas add a second risk. For example, a field may be a number in old documents and text in new ones. So we set types on purpose and let refresh fail loudly when a surprise appears.

Design checks for Power BI MongoDB integration

We settle these six points before the first page goes to a reader.

  • Each array has its own table in the model
  • Every table carries a stable key
  • Optional fields have a default or a blank rule
  • Dates convert to one time zone
  • Refresh reads a secondary node where possible
  • The reporting login holds read rights only

How our Power BI MongoDB integration work runs

The project moves through four stages, and a weekly demo closes each one.

  1. Sample the documents

    First we pull sample documents from each collection and chart how their shape varies over time.

  2. Choose route and scope

    Then we recommend a route from the table above. The written quote fixes it, along with the tables and reports.

  3. Flatten and model

    We build the tables and relationships in your own tenant, and we reconcile totals against the application.

  4. Hand over

    Finally, your developers receive the mapping from fields to columns, so a schema change does not catch anyone out.

Questions about MongoDB and Power BI

Is there a native Power BI connector for MongoDB?

Microsoft's connector list includes the MongoDB Atlas SQL connector. It serves data in MongoDB Atlas through the Atlas SQL interface and needs a federated database instance. So it does not cover every MongoDB deployment. For a self-hosted server we use ODBC, exports or a staging database instead, and we say which during the assessment.

Can Power BI read nested MongoDB documents?

Yes, but they need shaping first. Power Query can expand records and lists into columns and rows. However, expanding a list repeats the parent row, which inflates totals. Therefore we split nested lists into their own tables and relate them. That keeps every measure at the right level of detail.

Does a MongoDB source need a gateway?

Sometimes. A cloud cluster that the Power BI service can reach may refresh without one. But a server inside a private network needs a gateway, and the gateway machine needs the same driver as the author's desktop. We confirm the network path with your administrator before we schedule any refresh.

Is a staging database overkill for our size?

Often it is, and we say so. A few tidy collections work fine through a direct route. Still, deep nesting or heavy volume can make refresh slow and fragile. In that case a small staging layer pays off, because it moves the hard work out of Power Query.

Who handles the project at Power BI Agency?

One of our consultants handles it from the free 30-minute assessment through handover. We are a small team, a division of Sataware Technologies, and independent of Microsoft. Also, we deliver the work online. Call (480) 485-7373, and we respond within 2 hours.

Further reading from Microsoft Learn

Let's build your first dashboard together.

Tell us what you report on today. A consultant replies within 2 hours with next steps.

☎(480) 485-7373 ✉contact@sataware.com

Trusted partners

Microsoft Solutions Partner · AWS Partner

Why teams pick us

Power BIDashboards, models, reports
Microsoft FabricModernization and migration
Azure SQLDataflows and pipelines
Row-level securityEach user sees only their data
Power BI EmbeddedAnalytics in your product
Legacy BI migrationTableau, Qlik, Cognos, OBIEE
50 client reviewsReal names, real projects
WorldwideWorking across time zones
Your own accountData stays in your Microsoft 365
One teamFrom first call to handover
Free assessment30 minutes, no obligation
Quote in 48 hoursScope, timeline and price
Mon to Fri, 8 to 6 CTSales and new projects
Secure HTTPSEncrypted in transit
Private enquiriesNever shared or sold

Explore Power BI Agency