> ## Documentation Index
> Fetch the complete documentation index at: https://docs.textql.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PowerBI Connector

> Connecting PowerBI to TextQL

The PowerBI connector allows you to integrate your Microsoft PowerBI workspaces and datasets with TextQL, enabling Ana to query and analyze your PowerBI data directly. This connector uses Azure Active Directory (Azure AD) application registration for secure authentication.

With the PowerBI connector, you can:

* Discover and sync reports and datasets from your PowerBI workspaces
* Query your PowerBI data using natural language through Ana
* Get insights from your PowerBI reports and visualizations

## Prerequisites

To set up the PowerBI connector, you'll need:

* **Administrator access** to your organization's Azure portal for app registration
* **Workspace admin access** in PowerBI to grant permissions
* **PowerBI Pro or Premium** license

## Step 1: Azure AD App Registration

First, you need to create an Azure AD application registration to obtain the required credentials.

### 1.1 Navigate to Azure Portal

Go to [https://portal.azure.com](https://portal.azure.com) and sign in with your organizational account.

<Frame caption="Azure portal sign-in page">
  <img height="200" src="https://mintcdn.com/textql/RpwvSkWliCulNBR_/images/datasources/business-intel/powerbi/1-azure-login-page.png?fit=max&auto=format&n=RpwvSkWliCulNBR_&q=85&s=ac85422fba4d2e9848d9e93dc2068eac" alt="Azure portal sign-in page" data-path="images/datasources/business-intel/powerbi/1-azure-login-page.png" />
</Frame>

### 1.2 Create a New App Registration

Navigate to **Azure Active Directory** > **App registrations** and click **+ New registration**.

<Frame caption="Azure App Registrations page">
  <img height="200" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/2-azure-app-registrations-page.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=d37d809db4ffb2d4b62ab37226d2464d" alt="Azure App Registrations page" data-path="images/datasources/business-intel/powerbi/2-azure-app-registrations-page.png" />
</Frame>

Fill in the registration form:

* **Name**: Choose a descriptive name (e.g., "TextQL PowerBI Connector")
* **Supported account types**: Select "Accounts in this organizational directory only"
* **Redirect URI**: Leave blank (not required for service principal authentication)

<Frame caption="Register an application form">
  <img height="200" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/3-azure-register-app-form.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=3e494af5b648555ce69a28a9d71aa06f" alt="Register an application form" data-path="images/datasources/business-intel/powerbi/3-azure-register-app-form.png" />
</Frame>

Click **Register** to create the application.

### 1.3 Copy the Tenant ID and Application (Client) ID

After registration, you'll be taken to the application overview page. Here you can find two critical pieces of information:

<Frame caption="Application overview showing Tenant ID and Application (Client) ID">
  <img height="200" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/4-azure-app-overview-credentials.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=1ce02f47fc991f82077288f9903fd9d5" alt="Application overview showing credentials" data-path="images/datasources/business-intel/powerbi/4-azure-app-overview-credentials.png" />
</Frame>

Copy and save:

* **Directory (tenant) ID**: This is your Azure Tenant ID
* **Application (client) ID**: This is your Application (Client) ID

### 1.4 Generate a Client Secret

Navigate to **Certificates & secrets** in the left sidebar and click **+ New client secret**.

<Frame caption="Certificates & secrets page">
  <img height="200" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/5-azure-add-client-secret.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=48ff5eb61ab440974adc883980331a7e" alt="Certificates & secrets page" data-path="images/datasources/business-intel/powerbi/5-azure-add-client-secret.png" />
</Frame>

Add a description and choose an expiration period for your secret:

<Frame caption="Add a client secret form">
  <img height="200" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/6-azure-add-client-secret-form.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=487ca69b7aa3462f3630fbd03cc73744" alt="Add a client secret form" data-path="images/datasources/business-intel/powerbi/6-azure-add-client-secret-form.png" />
</Frame>

After clicking **Add**, copy the **Value** immediately - this is your Client Secret.

<Warning>
  **Important**: The client secret value is only displayed once. Make sure to copy it immediately and store it securely. If you lose it, you'll need to generate a new one.
</Warning>

<Frame caption="Client secret created - copy the Value">
  <img height="200" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/7-azure-client-secret-created.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=2aa5bb5424181cc3ee7d87fcb5fb3a5c" alt="Client secret created" data-path="images/datasources/business-intel/powerbi/7-azure-client-secret-created.png" />
</Frame>

### 1.5 Configure PowerBI API Permissions

Navigate to **API permissions** in the left sidebar and click **+ Add a permission**.

<Frame caption="API permissions page">
  <img height="200" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/8-azure-add-api-permissions.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=6656d0aca6088bb4eaf8f3ae5eecdbd4" alt="API permissions page" data-path="images/datasources/business-intel/powerbi/8-azure-add-api-permissions.png" />
</Frame>

1. Select **PowerBI Service**

<Frame caption="Select PowerBI Service">
  <img height="200" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/9-azure-request-api-permission.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=79333d0cc15469d66b3ac659e9f3ad6e" alt="Select PowerBI Service" data-path="images/datasources/business-intel/powerbi/9-azure-request-api-permission.png" />
</Frame>

2. Choose **Delegated permissions**
3. Select the following permissions:
   * `Dataset.Read.All`
   * `Workspace.Read.All`
   * `Report.Read.All`

<Frame caption="API permissions page">
  <img height="200" src="https://mintcdn.com/textql/RpwvSkWliCulNBR_/images/datasources/business-intel/powerbi/10-azure-select-delegated-permissions.png?fit=max&auto=format&n=RpwvSkWliCulNBR_&q=85&s=bf8f01464254f26125929f83ba7c19c2" alt="API permissions page" data-path="images/datasources/business-intel/powerbi/10-azure-select-delegated-permissions.png" />
</Frame>

4. Click **Add permissions**

<Frame caption="Added API permissions">
  <img height="200" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/11-azure-api-permissions-added.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=18567384fde66440116ec8bd97cdbf79" alt="Added API Permissions" data-path="images/datasources/business-intel/powerbi/11-azure-api-permissions-added.png" />
</Frame>

<Note>
  Depending on your organization's policies, you may need to request admin consent for these permissions. Contact your Azure AD administrator if required.
</Note>

### 1.6 Enable Service Principal Access in PowerBI Admin Portal (Admin Only)

<Warning>
  **Administrator access required**: This step requires PowerBI Admin or Fabric Admin permissions. If you don't have admin access, contact your PowerBI administrator to complete this step.
</Warning>

Before service principals can access PowerBI workspaces, an administrator must enable this feature in the PowerBI admin portal.

#### Step 1: Navigate to Tenant Settings

Navigate to the [PowerBI Admin Portal](https://app.powerbi.com/admin-portal/tenantSettings) and you'll see the Tenant settings page.

<Frame caption="PowerBI Admin Portal - Tenant Settings Page">
  <img height="200" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/12-powerbi-admin-portal-tenant-settings.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=9ba2a486ddaa2ebd8623642433f698a0" alt="PowerBI Admin Portal Tenant Settings" data-path="images/datasources/business-intel/powerbi/12-powerbi-admin-portal-tenant-settings.png" />
</Frame>

#### Step 2: Search for Developer Settings

In the upper-right corner, use the "Filter by keyword" search box to search for **"developer"** or **"service principal"** to quickly find the relevant setting.

#### Step 3: Locate and Enable Service Principal Access

Scroll through the filtered results or navigate to the **"Developer settings"** section. Look for the setting named:

* **"Service principals can use Fabric APIs"** (in newer versions), or
* **"Service principals can use Power BI APIs"** (in older versions)

#### Step 4: Configure the Setting

1. Click on the setting to expand it
2. Toggle the switch to **Enabled**
3. Choose the scope:
   * **The entire organization**: All service principals can access PowerBI APIs
   * **Specific security groups**: Only service principals from designated Azure AD security groups can access (recommended for tighter control)
4. If you chose specific security groups, click **+ Add** and search for your security group
5. Click **Apply** at the bottom to save your changes

<Tip>
  **Recommended**: For better security, create a dedicated Azure AD security group for PowerBI service principals and add only the specific applications that need access. This provides better audit trails and easier access management.
</Tip>

<Note>
  This setting may take a few minutes to propagate. If you're enabling this for the first time, wait 10-15 minutes before attempting to add the service principal to workspaces.
</Note>

#### Step 5: Enable Export Reports as Image Files

While still in the PowerBI Admin Portal Tenant settings, you also need to enable the **"Export reports as image files"** setting:

1. In the same Tenant settings page, use the search box to search for **"export"**
2. Look for the setting named **"Export reports as image files"**
3. Toggle the switch to **Enabled**
4. Choose the appropriate scope (entire organization or specific security groups)
5. Click **Apply** to save your changes

<Note>
  This setting allows TextQL to generate visual previews and thumbnails of your PowerBI reports when needed.
</Note>

## Step 2: PowerBI Workspace Configuration

After creating your Azure AD app registration and enabling service principal access, you need to add the service principal to your PowerBI workspace.

### 2.1 Navigate to Your PowerBI Workspace

Go to [https://app.powerbi.com](https://app.powerbi.com) and sign in with your PowerBI account.

Select the workspace you want to connect to TextQL.

### 2.2 Add Service Principal to Workspace

To grant your Azure AD application access to the workspace, you need to add it as a member.

1. In your PowerBI workspace, click the **Manage access** button in the top toolbar

<Frame caption="PowerBI workspace view">
  <img height="200" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/14-powerbi-workspace-view.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=1fad57f1f1e12c406bb0a240296ea455" alt="PowerBI workspace view" data-path="images/datasources/business-intel/powerbi/14-powerbi-workspace-view.png" />
</Frame>

2. In the "Manage access" dialog that appears, click **+ Add people or groups**

3. In the search box, type the name of your Azure AD application (e.g., "TextQL PowerBI Connector")

<Frame caption="PowerBI workspace with Manage access button">
  <img height="200" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/15-powerbi-workspace-settings.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=f1550f0f3799214008df7d754589fbe7" alt="PowerBI workspace settings" data-path="images/datasources/business-intel/powerbi/15-powerbi-workspace-settings.png" />
</Frame>

<Tip>
  If you can't find your application by name, you can also search by the **Application (Client) ID** from your Azure app registration.
</Tip>

4. Select your application from the search results. It will be labeled as **(Service Principal)**

5. Assign an appropriate role:
   * **Viewer**: Read-only access to datasets and reports (minimum required for TextQL)
   * **Contributor**: Can generate embed tokens for viewing reports in TextQL
   * **Member**: Full access to APIs and content (recommended for full functionality)
   * **Admin**: Full access including workspace management

6. Click **Add** to grant access

<Frame caption="Manage access dialog showing service principal">
  <img height="200" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/16-powerbi-workspace-manage-access-dialog.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=299bb64a8e52e382f9d6db8da3f685c8" alt="Manage access dialog with service principal" data-path="images/datasources/business-intel/powerbi/16-powerbi-workspace-manage-access-dialog.png" />
</Frame>

<Note>
  The service principal needs at least **Viewer** permissions to access workspace content for TextQL. If you need TextQL to create or modify content, assign **Contributor** or higher permissions.
</Note>

## Step 3: Creating the Connector in TextQL

Now that you have your Azure credentials and workspace configured, you can create the PowerBI connector in TextQL.

### 3.1 Navigate to the Connectors Page

Go to the [TextQL Connectors Page](https://app.textql.com/connectors) and click the **PowerBI** card to add a new PowerBI connector.

<Frame caption="TextQL Connectors page with PowerBI option">
  <img height="200" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/17-textql-connectors-page-with-powerbi.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=aee00281d207e74fe77a25c2a9927b0d" alt="TextQL Connectors page" data-path="images/datasources/business-intel/powerbi/17-textql-connectors-page-with-powerbi.png" />
</Frame>

### 3.2 Fill in the Connector Form

A form will appear asking for your PowerBI connection details:

<Frame caption="PowerBI connector creation form">
  <img height="200" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/18-textql-powerbi-connector-form.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=96f792b50985851e3344da46a63a7843" alt="PowerBI connector form" data-path="images/datasources/business-intel/powerbi/18-textql-powerbi-connector-form.png" />
</Frame>

Enter the credentials you obtained from Azure:

* **Connector Name**: A descriptive name for this connector (e.g., "Marketing PowerBI Workspace")
* **Azure Tenant ID**: The Directory (tenant) ID from your Azure app registration
* **Application (Client) ID**: The Application (client) ID from your Azure app registration
* **Client Secret**: The client secret value you generated earlier

### 3.3 Test and Create the Connector

Click **Test Connection** to verify your credentials are correct.

<Frame caption="Testing PowerBI connection">
  <img height="300" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/19-powerbi-connector-test-success.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=558219a6ff9096ab688a282c02ce2818" alt="PowerBI connection test successful" data-path="images/datasources/business-intel/powerbi/19-powerbi-connector-test-success.png" />
</Frame>

If the test succeeds, you'll see a green checkmark with the message "Connection test passed! You can now save the connector." Click **Create Connector** to save your PowerBI connector.

<Tip>
  If the connection test fails, verify that:

  1. All credentials are entered correctly
  2. The Azure AD application has the required PowerBI API permissions
  3. The service principal has been added to your PowerBI workspace with appropriate permissions
  4. The client secret hasn't expired
</Tip>

## Step 4: Syncing Your PowerBI Data

After creating your connector, TextQL will automatically navigate to the PowerBI Explorer and begin discovering your PowerBI content.

### 4.1 Automatic Discovery

When you click **"Create Connector"**, TextQL will:

1. Automatically navigate to the PowerBI Explorer page
2. **Automatically start discovering** reports and datasets from your PowerBI workspace

<Frame caption="PowerBI Explorer - automatic discovery in progress">
  <img height="300" src="https://mintcdn.com/textql/RdGXSnDCaDSBELiG/images/datasources/business-intel/powerbi/20-powerbi-explorer-discovered-empty.png?fit=max&auto=format&n=RdGXSnDCaDSBELiG&q=85&s=e72f6d98a334373ea21f1892fa2175ad" alt="PowerBI Explorer auto-discovery" data-path="images/datasources/business-intel/powerbi/20-powerbi-explorer-discovered-empty.png" />
</Frame>

The discovery process will identify:

* **Reports**: All reports and dashboards in your PowerBI workspace
* **Datasets**: All datasets with their tables and relationships
* **Workspaces**: Multiple workspaces if your service principal has access to them

### 4.2 Select Content to Sync

After discovery completes, you can select which items to sync:

1. Use the **search box** to find specific reports or datasets
2. Switch between **Reports** and **Datasets** tabs
3. Filter by **All**, **Synced**, or **Discovered** items
4. Select specific **workspaces** from the dropdown
5. Click the **+** icon on individual items to select them
6. Or use **"Select All Reports"**/**"Select All Datasets"** to sync multiple items at once
7. Click **"Sync X Items"** to sync the selected content

### 4.3 Troubleshooting: Missing Data Previews

If you don't see data previews or table metadata in the sync interface, this is likely due to PowerBI API access restrictions.
This does not affect your ability to chat with Ana about your data.

## Chatting with your dashboards

Once your PowerBI connector is set up and synced, you can start chatting with your dashboards. Here's how to attach your PowerBI data to a chat:

### Step 1: Start a New Chat

Navigate to [TextQL Chat](https://app.textql.com/chat/new) to begin asking questions about your PowerBI data.

<Frame caption="New chat interface">
  <img height="200" src="https://mintcdn.com/textql/Kg-I1NZcGyi2okPw/images/datasources/business-intel/powerbi/powerbi-step1-new-chat.png?fit=max&auto=format&n=Kg-I1NZcGyi2okPw&q=85&s=7e1890a2c230477de9d7212b348c2a39" alt="New chat interface" data-path="images/datasources/business-intel/powerbi/powerbi-step1-new-chat.png" />
</Frame>

### Step 2: Open Attachment Options

Click the **+** icon next to the message input to open the attachment dropdown.

<Frame caption="Click the + icon to show attachment options">
  <img height="200" src="https://mintcdn.com/textql/Kg-I1NZcGyi2okPw/images/datasources/business-intel/powerbi/powerbi-step2-attachment-dropdown.png?fit=max&auto=format&n=Kg-I1NZcGyi2okPw&q=85&s=3a1e1e2decb0fc22c95a1e95a08b64e1" alt="Attachment dropdown with PowerBI option" data-path="images/datasources/business-intel/powerbi/powerbi-step2-attachment-dropdown.png" />
</Frame>

### Step 3: Select PowerBI

Click **"Attach PowerBI"** from the dropdown menu.

### Step 4: Choose Your Connector

Select the PowerBI connector you want to use. You'll see the number of datasets and reports available.

<Frame caption="Select your PowerBI connector">
  <img height="200" src="https://mintcdn.com/textql/Kg-I1NZcGyi2okPw/images/datasources/business-intel/powerbi/powerbi-step3-connector-selection.png?fit=max&auto=format&n=Kg-I1NZcGyi2okPw&q=85&s=1063cab7b4ccfcd1024c536fa7c45784" alt="PowerBI connector selection" data-path="images/datasources/business-intel/powerbi/powerbi-step3-connector-selection.png" />
</Frame>

### Step 5: Select Datasets and Reports

Choose which datasets and reports you want to attach to this chat. You can select multiple items.

<Frame caption="Select datasets and reports to attach">
  <img height="200" src="https://mintcdn.com/textql/Kg-I1NZcGyi2okPw/images/datasources/business-intel/powerbi/powerbi-step4-dataset-selection.png?fit=max&auto=format&n=Kg-I1NZcGyi2okPw&q=85&s=a48fac6df32add6a4f342b20f398be77" alt="Dataset and report selection interface" data-path="images/datasources/business-intel/powerbi/powerbi-step4-dataset-selection.png" />
</Frame>

### Step 6: Confirm Selection

Once you've selected your items, the "Attach Selected" button will show the count of selected items.

<Frame caption="Confirm your selection">
  <img height="200" src="https://mintcdn.com/textql/Kg-I1NZcGyi2okPw/images/datasources/business-intel/powerbi/powerbi-step5-dataset-selected.png?fit=max&auto=format&n=Kg-I1NZcGyi2okPw&q=85&s=70c29156f667abc0678388d1be25ac84" alt="Dataset selection confirmed" data-path="images/datasources/business-intel/powerbi/powerbi-step5-dataset-selected.png" />
</Frame>

### Step 7: Data Attached

After clicking "Attach Selected", your PowerBI data will be attached to the chat and you can start asking Ana questions.

<Frame caption="PowerBI data successfully attached">
  <img height="200" src="https://mintcdn.com/textql/Kg-I1NZcGyi2okPw/images/datasources/business-intel/powerbi/powerbi-step6-attached-to-chat.png?fit=max&auto=format&n=Kg-I1NZcGyi2okPw&q=85&s=73c356182dd98af457d7ac00d7410428" alt="PowerBI data attached to chat" data-path="images/datasources/business-intel/powerbi/powerbi-step6-attached-to-chat.png" />
</Frame>

Ask Ana anything you want. She can see / filter your datasets and reports, and run DAX queries over your underlying data.

<Frame caption="Chat with Ana about your PowerBI data">
  <img height="200" src="https://mintcdn.com/textql/Kg-I1NZcGyi2okPw/images/datasources/business-intel/powerbi/powerbi-chat-with-ana.png?fit=max&auto=format&n=Kg-I1NZcGyi2okPw&q=85&s=8968a1c974dcf1a189d7689ff8d8d5bc" alt="PowerBI chat with Ana" data-path="images/datasources/business-intel/powerbi/powerbi-chat-with-ana.png" />
</Frame>

## Troubleshooting

### Connection Test Fails

If your connection test fails, check the following:

1. **Verify Azure credentials**: Ensure Tenant ID, Client ID, and Client Secret are correct
2. **Check API permissions**: Confirm your Azure AD app has the required PowerBI permissions
3. **Verify workspace access**: Ensure the service principal has been added to the PowerBI workspace
4. **Check secret expiration**: Client secrets expire - you may need to generate a new one
5. **Review Azure AD policies**: Some organizations have conditional access policies that may block service principal access

### Cannot See Expected Datasets

If you're connected but don't see expected datasets:

1. **Verify workspace permissions**: The service principal needs at least Viewer access to the workspace
2. **Check dataset permissions**: Some datasets may have row-level security (RLS) that restricts access

### Authentication Errors

If you encounter authentication errors while using the connector:

1. **Client secret expiration**: Generate a new client secret in Azure and update your connector
2. **Token issues**: Try disconnecting and reconnecting the connector
3. **Permission changes**: Verify that workspace permissions haven't been modified

## Next Steps

* Explore other [connector types](/core/datasources/the-connectors-page)
* Learn about [the Ontology](/core/ontology/overview) to organize your PowerBI data
* Set up [scheduled reports](/core/how-it-works/playbooks) based on your PowerBI data
