This page describes how to connect to either an Atlas federated database instance or an on-premises MongoDB Enterprise database with Power BI.
Prerequisites
Power BI Desktop 64 bit. Microsoft updates and releases Power BI monthly, and Atlas supports only the latest version of Power BI Desktop.
Windows operating system. To learn the Windows OS versions that Power BI Desktop supports, see Power BI System Requirements.
Procedure
Follow these steps to enable the SQL Interface and connect with Power BI.
Ensure you have enabled the SQL Interface for your cluster.
See Quick Start for detailed instructions on enabling the Atlas SQL Interface.
See On-Premise set up for detailed instructions on how to enable the SQL Interface for EA databases.
Download the MongoDB ODBC Driver.
Download the installer for the latest MongoDB ODBC Driver. See odbc-driver for more details on the MongoDB ODBC Driver.
Note
To use Direct Query, you must install MongoDB ODBC Driver version 1.2 or later.
Download and install the Power Bi connector file.
Note
The certified MongoDB Power BI Connector ships with Power BI Desktop and can be used for both Atlas and EA database connections. If your version of Power BI Desktop already has the MongoDB Atlas SQL connector, you can skip this step. To use a different version than the one bundled with Power BI Desktop, complete this step.
Move the connector file to the following directory path:
C:\Users\<user>\Documents\Power BI Desktop\Custom Connectors
.
Create this folder if it doesn't already exist.
Connect from Power BI Desktop.
Open Power BI Desktop.
Select Get data from the Home menu.
Find and select the MongoDB Atlas SQL connector.
Type
mongo
in the search bar to find the new connector.Select MongoDB Atlas SQL.
Click Connect.
Enter the URI and the database name and click OK.
The MongoDB URI is the URL is the from the previous step.
You can also enter a SQL query in the Native query field. Power BI uses the SQL query as the direct source for the data.
Enter your Atlas User name and Password and click Connect.
By default, a user can access all clusters and federated database instances in projects to which they have access. If you restricted access to specific clusters and federated database instances, you can grant access to the new federated database instance in the Edit User menu. To learn more, see Modify Database Users.
Direct Query
Direct Query is a connection mode available with the MongoDB Power BI connector version 1.2 and later. To use Direct Query, you must install MongoDB ODBC Driver version 1.2 or later.
Direct Query is alternative to the standard Import Mode, and allows you to query your database directly. This guarantees up-to-date data but may take longer to return results.
Direct Query does not support some actions. If you try to perform an unsupported action, Power BI prompts you to switch to Import Mode.