Connect to Power BI

Microsoft Power BI is a business analytics service that provides interactive visualizations with self-service business intelligence capabilities, enabling end users to create reports and dashboards by themselves without having to depend on information technology staff or database administrators.

When you use Azure Databricks as a data source with Power BI, you can bring the advantages of Azure Databricks performance and technology beyond data scientists and data engineers to all business users.

You can connect Power BI Desktop to your Azure Databricks clusters and Databricks SQL warehouses by using the built-in Azure Databricks connector. You can also publish Power BI reports to the Power BI service and enable users to access the underlying Azure Databricks data using single sign-on (SSO), passing along the same Azure Active Directory credentials they use to access the report.

Requirements

  • Power BI Desktop 2.85.681.0 or above. Download the latest version. To use data managed by Unity Catalog with Power BI, you must use Power BI Desktop 2.98.683.0 or above (October 2021 release).

    Note

    Power BI Desktop requires Windows. An alternative for other operating systems is to run Power BI Desktop on a physical host or a Windows-based virtual machine and then connect to it from your operating system.

    If you use a version of Power BI Desktop below 2.85.681.0, you also need to install the Databricks ODBC driver in the same environment as Power BI Desktop.

  • An Azure Active Directory token (recommended), an Azure Databricks personal access token, or your Azure Active Directory account credentials.

    For large imports that take close to one hour or longer, Databricks recommends that you use Azure Databricks personal access token authentication as there is a known token refresh issue when using Azure Active Directory.

    Note

    As a security best practice, when authenticating with automated tools, systems, scripts, and apps, Databricks recommends you use access tokens belonging to service principals instead of workspace users. To create access tokens for service principals, see Manage access tokens for a service principal.

  • An Azure Databricks cluster or Databricks SQL warehouse.

Connect to Power BI Desktop using Partner Connect

You can use Databricks Partner Connect to connect a cluster or SQL warehouse with Power BI Desktop in just a few clicks.

  1. Make sure your Azure Databricks account, workspace, and the signed-in user meet the requirements for Partner Connect.

  2. In the sidebar, click Partner Connect button Partner Connect.

  3. Click the Power BI tile.

  4. In the Connect to partner dialog, for Compute, choose the name of the Azure Databricks compute resource that you want to connect. If your selected persona is Data Science & Engineering or Databricks Machine Learning, choose a cluster or SQL warehouse. If your selected persona is Databricks SQL, choose a SQL warehouse.

  5. Choose Download connection file.

  6. Open the downloaded connection file, which starts Power BI Desktop.

  7. In Power BI Desktop, enter your authentication credentials:

    • Personal Access Token: Enter your Azure Active Directory token or Azure Databricks personal access token from the Requirements.
    • Azure Active Directory: Click Sign in and then follow the on-screen instructions.
    • Username / Password: Not applicable.
  8. Click Connect.

  9. Select the Azure Databricks data to query from the Power BI Navigator.

    Power BI Navigator

Connect to Power BI Desktop manually

Follow these instructions to connect to a cluster or SQL warehouse with Power BI Desktop.

Note

To connect faster with Power BI Desktop, use Partner Connect.

  1. Get the Server Hostname and HTTP Path.

  2. Start Power BI Desktop.

  3. Click Get data or File > Get data.

  4. Click Get data to get started.

  5. Search for Databricks, choose the Azure Databricks connector, and click Connect.

  6. Enter the Server Hostname and HTTP Path.

  7. Optionally, enter the default database and catalog to use for the connection.

  8. Select your Data Connectivity mode. For information about the difference between Import and DirectQuery, see Use DirectQuery in Power BI Desktop.

  9. Click OK.

  10. Enter your authentication credentials:

    • Personal Access Token: Enter your Azure Active Directory token or Azure Databricks personal access token from the Requirements.
    • Azure Active Directory: Click Sign in and then follow the on-screen instructions.
    • Username / Password: Not applicable.
  11. Click Connect.

  12. Select the Azure Databricks data to query from the Power BI Navigator. If Unity Catalog is enabled for your workspace, select a catalog before you select a schema and a table.

    Power BI Navigator

Using a custom SQL query

The Databricks connector provides the Databricks.Query data source that allows a user to provide a custom SQL query. This feature will be available in the Power BI February 2022 release.

  1. Follow the steps described in Connect with Power BI Desktop to create a connection, using Import as the data connectivity mode.

  2. In the Navigator, right click the top-most item containing the selected host name and HTTP path and click Transform Data to open the Power Query Editor.

    Click Transform Data in the Navigator

  3. In the function bar, replace the function name Databricks.Catalogs with Databricks.Query and apply the change. This creates a Power Query function that takes a SQL query as parameter.

  4. Enter the desired SQL query in the parameter field and click Invoke. This executes the query and a new table is created with the query results as its contents.

Access Azure Databricks data source using the Power BI service

When you publish a report to the Power BI service, you can enable users to access the report and underlying Azure Databricks data source using SSO:

  1. Publish your Power BI report from Power BI Desktop to the Power BI service.

  2. Enable single sign on (SSO) access to the report and underlying data source.

    1. Go to the underlying Azure Databricks dataset for the report in the Power BI service, expand Data source credentials, and click Edit credentials.
    2. On the configuration dialog, select Report viewers can only access this data source with their own Power BI identities using Direct Query and click Sign in.

    Enable SSO for Databricks data access

    With this option selected, access to the data source is handled using DirectQuery and managed using the Azure AD identity of the user who is accessing the report. If you don’t select this option, only you, as the user who published the report, have access to the Azure Databricks data source.

Automated HTTP proxy detection

Power BI Desktop version 2.104.941.0 and above (May 2022 release) has built-in support for detecting Windows system-wide HTTP proxy configuration. Download the latest version.

Power BI Desktop can automatically detect and use your Windows system-wide HTTP proxy configuration.

If the proxy server does not provide a CRL distribution point (CDP), Power BI may show the error message Details: "ODBC: ERROR [HY000] [Microsoft][DriverSupport] (1200) -The revocation status of the certificate or one of the certificates in the certificate chain is unknown.". To fix this error, complete the following steps:

  1. Create the file C:\Program Files\Microsoft Power BI Desktop\bin\ODBC Drivers\Simba Spark ODBC Driver\microsoft.sparkodbc.ini if it does not exist.

  2. Add the following config to your microsoft.sparkodbc.ini file:

    [Driver]
    CheckCertRevocation=0
    

Power BI Delta Sharing connector

The Power BI Delta Sharing connector allows users to discover, analyze, and visualize datasets shared with them through the Delta Sharing open protocol. The protocol enables secure exchange of datasets across products and platforms by leveraging REST and cloud storage.

For connection instructions, see Power BI: Read shared data.

Limitations

The Azure Databricks connector does not support web proxy.

In the Azure Databricks connector, the Databricks.Query data source is not supported in combination with DirectQuery mode.

The Delta Sharing connector is not yet available in the Power BI service.

The data that the Delta Sharing connector loads must fit into the memory of your machine. To ensure this, the connector limits the number of imported rows to the Row Limit that was set earlier.

Additional resources

Support