Docs Menu
Docs Home
/
MongoDB Atlas
/ / /

Connect to Atlas SQL from Power BI

On this page

  • Prerequisites
  • Procedure
  • Direct Query

This page describes how to connect to a cluster with Atlas SQL and Power BI using the Power BI Connector.

  • An Atlas cluster running MongoDB version 5.0 or later.

  • 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.

Follow these steps to enable Atlas SQL and connect with Power BI.

1
  1. If it's not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.

  2. If it's not already displayed, select your desired project from the Projects menu in the navigation bar.

  3. If it's not already displayed, click Clusters in the sidebar.

    The Clusters page displays.

2
  1. Under Atlas SQL, click Connect.

    1. On the lower right side of the cluster card under Atlas SQL, click Connect.

    2. If the Introducing the Atlas SQL Interface dialog box displays, click Get Started.

  2. Click Quick Start

    Quick Start configures a federated database instance for your cluster with the default settings.

    To set up Advanced Configuration, including querying across Atlas data sources or limiting the namespaces to query, you must Manually Create a Federated Database Instance for Atlas SQL.

  3. Under Create an Atlas SQL Connection for this cluster, click Create.

  4. Under Select your driver, select Power BI Connector.

  5. Under Get Connection String, select a database and copy the URL.

    The URL is required to connect from Power BI Desktop.

3

Download the installer for the latest MongoDB ODBC Driver.

Note

To use Direct Query, you must install MongoDB ODBC Driver version 1.2 or later.

4

Note

The MongoDB Atlas Power BI Connector is included with Power BI Desktop. If your version of Power BI Desktop already has the MongoDB connector, you can skip this step. To use a different version than the one bundled with Power BI Desktop, complete this step.

  1. Download the connector file.

  2. 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.

5
  1. Open Power BI Desktop.

  2. Select Get data from the Home menu.

  3. Find and select the MongoDB Atlas SQL connector.

    1. Type mongo in the search bar to find the new connector.

    2. Select MongoDB Atlas SQL.

    3. Click Connect.

  4. 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.

  5. 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 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. Direct Query allows you to query your database directly, which guarantees up-to-date data, but may take longer to return results.

Some actions aren't supported by Direct Query. If you try to perform an unsupported action, Power BI prompts you to switch to Import Mode.

Back

Tableau