---
title: Connect Power BI as an external knowledge source
description: Add business definitions from Power BI semantic models to Genie Ontology through a Unity Catalog connection.
canonical_url: https://docs.databricks.com/aws/en/genie/genie-ontology/external-knowledge-sources/power-bi
---

# Connect Power BI as an external knowledge source

Databricks connects to your Power BI instances and pulls in metadata from your semantic models and reports. This metadata helps make Genie Ontology smarter and enables lineage between Databricks and Power BI. Power BI is an [external knowledge source](https://docs.databricks.com/aws/en/genie/genie-ontology/external-knowledge-sources/index.md).

## Before you begin

Only Power BI connections in Unity Catalog that use OAuth Machine to Machine are supported. Setting up Power BI as an external knowledge source involves Power BI and Databricks. Each part of the setup needs different permissions.

> [!IMPORTANT]
>
> While **Enable Genie Ontology** or **Enable lineage** is selected, Databricks pulls in metadata from every Power BI workspace that the connection's service principal can access. Ontology snippets created from that metadata are available to all users in your Databricks account, regardless of their access in Power BI. To limit what Databricks pulls in, add each connection's service principal only to the Power BI workspaces that you want to include, or [clear](https://docs.databricks.com/aws/en/genie/genie-ontology/external-knowledge-sources/power-bi.md#turn-off) **Enable Genie Ontology** and **Enable lineage** for the connection.

### <a id="power-bi-requirements" />Power BI requirements

Before you create the connection, create a service principal in Microsoft Entra and give it access to the Power BI workspaces that you want Databricks to pull in metadata from:

1. Register a Microsoft Entra app to create a service principal, and generate a client secret. See [Register a Microsoft Entra app and create a service principal](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal).
2. Add the service principal to each Power BI workspace that you want Databricks to access, with at least the **Contributor** role. See [Give users access to workspaces](https://learn.microsoft.com/fabric/fundamentals/give-access-workspaces).

Databricks creates ontology snippets and lineage only for semantic models and reports in those workspaces that are connected to Databricks tables.

### Databricks requirements

To create the Power BI connection and pull in metadata, you need the following:

* Your workspace must have access to serverless compute. See [Serverless compute requirements](https://docs.databricks.com/aws/en/compute/serverless/index.md#requirements).
* Your workspace must not have the [compliance security profile](https://docs.databricks.com/aws/en/security/privacy/security-profile.md) enabled.

## <a id="connect" />Turn on ontology and lineage for a Power BI connection

You turn on ontology and lineage for each Power BI connection in Unity Catalog that uses OAuth Machine to Machine. You don't need a Power BI job task. After you select **Enable Genie Ontology**, Databricks starts pulling in metadata through the connection on its next scheduled run. When Genie uses a snippet created from Power BI metadata to answer a question, the snippet appears in the response's citations.

Follow one of the following options.

### Option 1: Existing Unity Catalog connection

Use this option if you already have a Power BI connection in Unity Catalog that uses OAuth Machine to Machine.

Check the connection's settings and turn on ontology and lineage:

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/aws/en/images/product-icons/DataIcon.svg) **Catalog** in the sidebar to open Catalog Explorer.
2. Open the Power BI connection.
3. Under **Advanced options**, make sure that **Enable Genie Ontology** and **Enable lineage** are selected.

Make sure that the connection's service principal meets the [Power BI requirements](https://docs.databricks.com/aws/en/genie/genie-ontology/external-knowledge-sources/power-bi.md#power-bi-requirements).

### Option 2: New Unity Catalog connection

Use this option if you don't have a Power BI connection that uses OAuth Machine to Machine.

Create a Power BI connection in Unity Catalog that stores the service principal credentials from Microsoft Entra. Follow the steps in [Create a Power BI connection in Unity Catalog for orchestration](https://docs.databricks.com/aws/en/partners/bi/power-bi/uc-connect.md), and do the following:

* For **Auth type**, select **OAuth Machine to Machine**.
* For credentials, enter the client ID, client secret, and tenant ID from Microsoft Entra.
* In **Step 2** of the **Set up connection** wizard, under **Advanced options**, select **Enable Genie Ontology** and **Enable lineage**.

## How Databricks pulls in Power BI metadata

Databricks reads metadata from Power BI through the Power BI connections in Unity Catalog. The following sections describe which APIs Databricks calls, what metadata it pulls in, and how data access works for the ontology snippets created from it.

### APIs and metadata

For each Power BI connection that has **Enable Genie Ontology** or **Enable lineage** selected, Databricks calls the following APIs through the connection:

| API                                                                                                                                   | What Databricks gets                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Power BI [Get Groups](https://learn.microsoft.com/rest/api/power-bi/groups/get-groups)                                                | The Power BI workspaces that the service principal can access.                                                                                                          |
| Power BI [Get Datasets In Group](https://learn.microsoft.com/rest/api/power-bi/datasets/get-datasets-in-group)                        | The semantic models in each workspace.                                                                                                                                  |
| Fabric [Get Semantic Model Definition](https://learn.microsoft.com/rest/api/fabric/semanticmodel/items/get-semantic-model-definition) | Each semantic model's definition: tables, columns, data types, storage mode, DAX measure formulas, calculated columns, Power Query (M) expressions, and diagram layout. |
| Fabric [Get Report Definition](https://learn.microsoft.com/rest/api/fabric/report/items/get-report-definition)                        | Each report's definition.                                                                                                                                               |

Ontology snippets don't include row-level security (RLS) role definitions and members, or Power BI asset owner email addresses.

Databricks refreshes this metadata every 7 days. The metadata stays in your workspace's region and isn't visible as a Unity Catalog table.

### Ontology snippets and data access

Ontology snippets contain metadata, such as measure definitions and relationships, not the data in your tables. Unity Catalog permissions still govern access to that data. Users who don't have access to the Unity Catalog tables that a snippet references can't query those tables through Genie.

If a Power BI asset is removed, or the connection's service principal can no longer access it, Genie stops using the snippets created from that asset.

## <a id="lineage" />Power BI lineage

When **Enable lineage** is selected for a connection, Databricks records Power BI semantic models and reports that are connected to Databricks tables as [external metadata objects](https://docs.databricks.com/aws/en/data-governance/unity-catalog/external-lineage.md), with lineage edges to those tables. These Power BI assets appear downstream of those tables in the Unity Catalog lineage graph. See [Lineage in Unity Catalog](https://docs.databricks.com/aws/en/data-governance/unity-catalog/data-lineage.md).

## <a id="turn-off" />Turn off ontology or lineage for a connection

To turn off ontology, lineage, or both for a Power BI connection, do the following:

1. In Catalog Explorer, open the Power BI connection.
2. Under **Advanced options**, clear **Enable Genie Ontology**, **Enable lineage**, or both.

When you clear **Enable Genie Ontology**, Genie stops serving ontology snippets from that connection. When you clear both options, Databricks stops pulling in metadata through the connection.

## Limitations

* Databricks doesn't capture usage activity, such as report views.
* You can't limit ontology snippets to specific users or groups. To stop serving them, clear **Enable Genie Ontology** for the connection.

## Additional resources

* [External knowledge sources](https://docs.databricks.com/aws/en/genie/genie-ontology/external-knowledge-sources/index.md)
* [Genie Ontology](https://docs.databricks.com/aws/en/genie/genie-ontology/index.md)
