Import MongoDB Data into the Power BI Service for Visualizations

Ready to get started?

Learn more about CData Connect Cloud or sign up for free trial access:

  Free Trial


Use CData Connect Cloud to create an OData feed for MongoDB and create custom reports in the Power BI Service.

Power BI transforms your company's data into rich visuals for you to collect and organize so you can focus on what matters to you. When paired with CData Connect Cloud, you get access to MongoDB data for visualizations, dashboards, and more. This article shows how to use CData Connect Cloud to generate an OData feed for MongoDB, insert MongoDB data into Power BI and then create reports on MongoDB data in the Power BI service.

NOTE: You can also use the on-premise data gateway and the SQL interface in Connect Cloud to connect to MongoDB data in real-time (instead of importing the data). Read how in the related Knowledge Base article.

Configuring Connect Cloud

To work with MongoDB data in Power BI online, we need to connect to MongoDB from Connect Cloud, provide user access to the connection, and create OData endpoints for the MongoDB data.

(Optional) Add a New Connect Cloud User

As needed, create Users to connect to MongoDB through Connect Cloud.

  1. Navigate to the Users page and click Invite Users
  2. Enter the new user's email address and click Send to invite the user
  3. You can review and edit users from the Users page

Add a Personal Access Token

If you are connecting from a service, application, platform, or framework that does not support OAuth authentication, you can create a Personal Access Token (PAT) to use for authentication. Best practices would dictate that you create a separate PAT for each service, to maintain granularity of access.

  1. Click on your username at the top right of the Connect Cloud app and click User Profile.
  2. On the User Profile page, scroll down to the Personal Access Tokens section and click Create PAT.
  3. Give your PAT a name and click Create.
  4. The personal access token is only visible at creation, so be sure to copy it and store it securely for future use.

Connect to MongoDB from Connect Cloud

CData Connect Cloud uses a straightforward, point-and-click interface to connect to data sources.

  1. Log into Connect Cloud, click Connections and click Add Connection
  2. Select "MongoDB" from the Add Connection panel
  3. Enter the necessary authentication properties to connect to MongoDB.

    Set the Server, Database, User, and Password connection properties to connect to MongoDB. To access MongoDB collections as tables you can use automatic schema discovery or write your own schema definitions. Schemas are defined in .rsd files, which have a simple format. You can also execute free-form queries that are not tied to the schema.

  4. Click Create & Test
  5. Navigate to the Permissions tab in the Add MongoDB Connection page and update the User-based permissions.

Add MongoDB OData Endpoints in Connect Cloud

After connecting to MongoDB, create OData Endpoints for the desired table(s).

  1. Navigate to the OData page and click Add to create new OData endpoints
  2. Select the MongoDB connection (e.g. MongoDB1) and click Next
  3. Select the table(s) you wish to work with and click Confirm

With the connection and OData endpoints configured, you are ready to connect to MongoDB data from Power BI online.

Publish a Dataset from Power BI Desktop

With OData endpoints added to Connect Cloud, you can create a dataset in Power BI desktop using OData connectivity and publish the dataset to the Power BI service.

  1. Open Power BI, click Get Data -> More, then select OData feed, and click Connect.
  2. Set URL to the Base URL of your Connect Cloud instance: https://cloud.cdata.com/api/odata/service and click OK.
  3. Set User name and Password to a user name (e.g. user@mydomain.com) and PAT from above.
  4. Select the full Base URL (https://cloud.cdata.com/api/odata/service) as the level to apply the settings to.
  5. Select the table(s) to visualize in the Navigator dialog.
  6. Click Load to pull the data into Power BI.
  7. Define any relationships between the selected entities on the Relationships tab.
  8. Click Publish (from the Home menu) and select a Workspace.

Build Reports and Dashboards on MongoDB Data in the Power BI Service

Now that you have published a dataset to the Power BI service, you can create new reports and dashboards based on the published data:

  1. Log in to PowerBI.com.
  2. Click Workspaces and select a workspace.
  3. Click Create and select Report.
  4. Select the published dataset for the report.
  5. Choose fields and visualizations to add to your report.

Live Access to MongoDB Data from Cloud Applications

Now you have a direct connection to live MongoDB data from the Power BI service. You can create more data sources and new visualizations, build reports, and more — all without replicating MongoDB data.

To get live data access to 100+ SaaS, Big Data, and NoSQL sources directly from your cloud applications, see the CData Connect Cloud.