Discover how a bimodal integration strategy can address the major data management challenges facing your organization today.
Get the Report →Visualize Live HubDB Data of Power BI Report Builder in Power BI Service
Use CData Power BI Connectors to connect to live HubDB data using Power BI Report Builder and create custom reports in the Power BI Service through the On-Premises Gateway.
CData Power BI Connectors provide self-service integration with Microsoft Power BI. The CData Power BI Connector for HubDB links your Power BI reports to real-time HubDB data. You can monitor HubDB data through dashboards and ensure that your analysis reflects HubDB data in real time by scheduling refreshes or refreshing on demand. This article details how to use the Power BI Connector to create real-time visualizations of HubDB data in Microsoft Power BI Desktop.
Create and Configure a DSN
Installing the Power BI Connector creates a DSN (data source name) with the name CData PBI HubDB that Power BI uses to connect to the data source. Configure the DSN by filling in the required connection properties.
You can use the Microsoft ODBC Data Source Administrator to create a new DSN or configure (and rename) an existing DSN. From the Start menu, enter "ODBC Data Sources." Ensure that you run the version of the ODBC Administrator that corresponds to the bitness of your Power BI Desktop installation (32-bit or 64-bit).
There are two authentication methods available for connecting to HubDB data source: OAuth Authentication with a public HubSpot application and authentication with a Private application token.
Using a Custom OAuth App
AuthScheme must be set to "OAuth" in all OAuth flows. Be sure to review the Help documentation for the required connection properties for you specific authentication needs (desktop applications, web applications, and headless machines).
Follow the steps below to register an application and obtain the OAuth client credentials:
- Log into your HubSpot app developer account.
- Note that it must be an app developer account. Standard HubSpot accounts cannot create public apps.
- On the developer account home page, click the Apps tab.
- Click Create app.
- On the App info tab, enter and optionally modify values that are displayed to users when they connect. These values include the public application name, application logo, and a description of the application.
- On the Auth tab, supply a callback URL in the "Redirect URLs" box.
- If you're creating a desktop application, set this to a locally accessible URL like http://localhost:33333.
- If you are creating a Web application, set this to a trusted URL where you want users to be redirected to when they authorize your application.
- Click Create App. HubSpot then generates the application, along with its associated credentials.
- On the Auth tab, note the Client ID and Client secret. You will use these later to configure the driver.
Under Scopes, select any scopes you need for your application's intended functionality.
A minimum of the following scopes is required to access tables:
- hubdb
- oauth
- crm.objects.owners.read
- Click Save changes.
- Install the application into a production portal with access to the features that are required by the integration.
- Under "Install URL (OAuth)", click Copy full URL to copy the installation URL for your application.
- Navigate to the copied link in your browser. Select a standard account in which to install the application.
- Click Connect app. You can close the resulting tab.
Using a Private App
To connect using a HubSpot private application token, set the AuthScheme property to "PrivateApp."
You can generate a private application token by following the steps below:
- In your HubDB account, click the settings icon (the gear) in the main navigation bar.
- In the left sidebar menu, navigate to Integrations > Private Apps.
- Click Create private app.
- On the Basic Info tab, configure the details of your application (name, logo, and description).
- On the Scopes tab, select Read or Write for each scope you want your private application to be able to access.
- A minimum of hubdb and crm.objects.owners.read is required to access tables.
- After you are done configuring your application, click Create app in the top right.
- Review the info about your application's access token, click Continue creating, and then Show token.
- Click Copy to copy the private application token.
To connect, set PrivateAppToken to the private application token you retrieved.
Get HubDB Data
With the data source configured, follow the steps below to load data from HubDB tables into a dataset.
Select Tables and Views to Load
- Open the Power BI Report Builder and choose Blank Report.
- Click On Data Sources -> Add Data Source.
- Choose Connection Type as ODBC and click on "Build."
- Click on "Use user or system data source name" and select CData PBI HubDB Sys.
- Click on Test Connection in Connection Properties and make sure it is successful.
- Click Test Connection in the Data Source Properties Window and click on OK.
- With the Data Source configured, you can configure the DataSets. Click on DataSets -> Add Dataset. Choose the Data Source you recently configured and click on Query Designer.
- Write an SQL Command for the table you wish to generate a report on and click "Run" (!). You can find the table names from the Metadata Tab in the CData Connection Manager in DSN.
- Click on "Validate Query." You will see the Column names on the left-hand side of the window. Now, you can generate any report according to your use case.
Create Data Visualizations
After loading HubDB data into Power BI Report Builder, you can create data visualizations in the Report view by dragging fields from the Fields pane onto the canvas. Follow the steps below to create a chart:
- Navigate to Insert -> Chart -> Insert Chart -> Select Chart Type and click OK.
- Select Values, Category Groups, and Series Groups. You can apply filters to the page, report, or to a single visualization by dragging fields onto the Filters pane. To filter on the field value, select one of the values displayed in the Filters pane.
Configure Data Refresh on PowerBI.com
Follow the steps below to configure automatic data refresh through the Power BI Gateway. The gateway enables the Power BI cloud service to connect to the DSN on your machine.
Selecting a Gateway Mode
You need to select a gateway mode when you install the gateway:
- Gateway (personal mode): Use the gateway in personal mode if you only need to publish to PowerBI.com and refresh reports. The gateway runs under your Windows user account.
- (Recommended) Gateway (Standard mode - formerly Enterprise): Use the default gateway if you use other Azure services requiring a gateway. You also need the default gateway if multiple users need to access the gateway. You need a system DSN to connect through the default gateway. (System DSNs can be accessed system-wide, while user DSNs are restricted to a specific user account.) You can use the CData Power BI Salesforce system DSN configured as the last step of the connector installation.
Configuring the Gateway (Personal Mode)
Publishing through the gateway in personal mode requires an installed gateway with access to custom connectors.
- Run the CData Power BI Connector installer. Download the Power BI Gateway (Personal Mode) if you have not already done so.
- Select the on-premises data gateway (personal mode) option.
- Sign in to the gateway.
- In the Connectors section of the gateway settings, enable the "custom data connectors" option. You can also specify an alternate path to the custom data connector .pqx files here.
Note: The CData Power BI Connectors install the .pqx files to the default folder. Path: "Your User Home\Documents\Power BI Desktop\Custom Connectors."
Configuring the Gateway (Standard Mode)
Publishing through the gateway requires an installed gateway with access to customer connectors and a configured connection to the DSN for Salesforce from PowerBI.com.
Set Up the Gateway
Follow the steps below to configure the gateway on your machine:
- Run the CData Power BI Connector installer. If you have not already done so, download the Power BI Gateway (Standard Mode).
- Select the on-premises data gateway (recommended) option.
- Sign into the gateway.
- Name the gateway and specify a recovery key.
- In the Connectors section, choose a folder where the gateway will look for the CData Power BI Connector. This article uses "C:\Users\PBIEgwService\Documents\Power BI Desktop\Custom Connectors\". Alternatively, copy the .pqx files of the CData Connectors (found in "C:\Users\USERNAME\Documents\Power BI Desktop\Custom Connectors\") to the folder you configured.
Note: The account configured for the service (NT SERVICE\PBIEgwService) must be able to access the folder chosen for the gateway. If needed, you can change the service account in the Service Settings section of the gateway installer.
- Confirm that the entry CData.HubDB is in the list in the Connectors section.
Connect to Salesforce Data from PowerBI.com
- Add a data source to the gateway: Log into PowerBI.com and from the Settings menu, select Manage Gateways and select your gateway.
- Select "Allow user's custom data connectors to refresh through this gateway cluster."
- Click Apply to save your changes.
- Click the option to add a data source to the gateway.
- In the Data Source Settings section, enter a name for the data source. In the Data Source Type menu, select CData Power BI Connector for HubDB.
- In the Data Source Name box, enter the system DSN: CData PBI HubDB Sys.
Publish to PowerBI.com
You can now publish refreshable reports and their underlying datasets. Follow the steps below to publish and complete the data refresh configuration for a dataset.
- In Power BI Desktop Report Builder, click "Publish" on the Home ribbon to publish the report.
- On PowerBI.com, select the workspace where the report is uploaded and provide a file name.
- Click on "Open HubDB in Power BI" to open the report in the Power BI Service in your browser.
Error Encountered and Solution
If you get an error message like "Unable to render paginated report," then you can follow the instructions below to resolve the error.
Create a Data Source in the Power BI Service
- Click on "Update data source credentials".
- Click on "Continue".
- In the Gateway Connection section, enable the option to use a gateway and select your gateway. You may need to add the data source to the gateway manually:
- Expand the Gateway under the Actions column.
- Click the link to "Manually add to gateway."
- Click on Add to gateway (refer to the screenshot below). Choose Basic as Authentication because Anonymous Authentication is not supported. Provide the username and password for the Power BI Service Account.
- After the Data Source is successfully created, select the Connection name in "Maps to" and apply the changes.
- Go to Power BI Report Builder and click "Open HubDB in Power BI". You can now see the created report in the Power BI Service (Online).
At this point, you will have a Power BI report built on top of live HubDB data using Power BI Report Builder and CData Power BI connectors. Learn more about the CData Power BI Connectors for HubDB and download a free trial from the CData Power BI Connector for HubDB page. Let our Support Team know if you have any questions.