logo
search
Power Query Problems

How to Split MongoDB ODBC Data into Multiple Power Query Tables

Elise WilliamsElise Williams Sep 28, 2026 869 views

Question details

The user wants to distribute data retrieved from a single MongoDB ODBC connection into multiple separate tables within Power Query, while ensuring the original connection remains active and efficient.

How to Split MongoDB ODBC Data into Multiple Power Query Tables
Product
Excel / Power BI
Device & OS
not provided
Scenario
Importing and transforming complex, nested MongoDB database structures via an ODBC connection into separate, manageable relational tables.
Observed behavior
Looking for the correct Power Query workflow to route a single ODBC data source into multiple destination tables without duplicating external queries or breaking the live connection.
Before you start

Ensure you have the correct MongoDB ODBC driver installed and configured in your system's ODBC Data Source Administrator, and that you have valid credentials to securely access the database.

Solution 1Recommended

Use a Staging Query and Query References

This is the most efficient method to split data. By creating one main connection and referencing it for multiple tables, you keep the ODBC connection active without querying the database multiple times.

Power Query allows you to create a primary 'staging' query that holds the active connection to your MongoDB ODBC source. You can then create dependent queries (references) that branch off from this staging query to form separate tables.

1
Establish the ODBC Connection

Open Power Query, click 'Get Data', select 'From Other Sources', and choose 'From ODBC'. Select your MongoDB ODBC Data Source Name (DSN) and enter your credentials to import the data.

2
Create a Staging Query

Once the data loads in the Power Query Editor, do not perform heavy transformations yet. Right-click this query in the Queries pane, select 'Properties', and uncheck 'Enable load to report/worksheet'. Rename it to 'MongoDB_Staging'.

3
Reference the Staging Query

Right-click the 'MongoDB_Staging' query and select 'Reference'. This creates a new query linked to the staging data. Rename this new query to represent your first split table (e.g., 'Customer_Table').

4
Transform and Repeat

Apply filters, remove unnecessary columns, and expand JSON/MongoDB records in the 'Customer_Table' query. Repeat the 'Reference' step on the staging query to create additional separate tables as needed.

5
Load the Split Tables

Click 'Close & Load To...' and ensure your referenced queries are set to load as Tables into your Excel worksheet or Power BI data model.

Use a Staging Query and Query References
Performance Benefit: Using a single staging query minimizes the load on your MongoDB server, as Power Query will only execute the underlying ODBC fetch once and build the multiple tables from the cached result.
Free Microsoft Office alternative

Experience Lightweight Data Analysis with WPS Office

While advanced ODBC integrations and Power Query M-scripting are heavily tied to the Microsoft ecosystem, WPS Office provides an incredibly fast, highly compatible alternative for everyday data processing. Once your database data is extracted to CSV or Excel formats, WPS Spreadsheet offers powerful data manipulation without the heavy resource usage.

  1. 1. Download WPS Office: Visit the official WPS website and download the free version of WPS Office.
  2. 2. Open Your Data File: Launch WPS Spreadsheet and open your exported MongoDB data (CSV or XLSX format).
  3. 3. Analyze and Organize: Use WPS Office's built-in filtering, PivotTables, and advanced formulas to effortlessly analyze your dataset.
Highly compatible with Microsoft Excel (.xlsx, .xls, .csv) formatsLightweight application that runs smoothly on most devices without laggingBuilt-in data analysis tools, PivotTables, and advanced chartingFree to download and easy to use with a familiar, tabbed interface
microsoft office alternative - wps office

Frequently Asked Questions

Can I keep the ODBC connection active while splitting tables in Power Query?

Yes. By using a single staging query connected to the ODBC source and creating multiple 'Referenced' queries from it, the connection remains active and centralized. Power Query will fetch the data once and distribute it to the referenced tables.

Why is my MongoDB ODBC connection running slowly in Power Query?

MongoDB is a NoSQL database, and pulling large, unoptimized, nested documents through an ODBC driver can cause performance bottlenecks. Ensure you filter the data as early as possible in your query, ideally passing native SQL queries directly to the ODBC driver if supported.

Does WPS Office support Microsoft Power Query?

WPS Office offers standard external data import capabilities (like importing from text, CSV, and basic web queries) and excellent PivotTable support, but for advanced M-language scripting and specialized ODBC transformations, Microsoft Excel or Power BI is required. You can, however, easily process the exported datasets in WPS Spreadsheet.