# Power BI Data Source
URL: https://docs.valsight.ai/power-bi-data-source/
Description: Import the tables of a Power BI semantic model into Valsight as a data source.
A **Power BI** data source imports tables of a Power BI semantic model into Valsight. You pick a workspace, a semantic model in it and the tables you need. Valsight then reads those tables through the Power BI REST API and stores them as data tables, which models use through the `DATA` function like any other data source.

## What it is

A Power BI data source is set up in three choices: **Workspace**, then **Semantic Model**, then **Tables to Import**. All three are lists read from Power BI, so you never type an id or a query. Valsight reads each selected table in full, row by row as it is stored in the model.

Only tables are read. A figure that exists only as a measure in a report is not available: add it to the semantic model as a table first. Valsight aggregates the data itself, so import the detail rows rather than a pre-summarised table.

Valsight reads Power BI as **Your own Power BI account**: the user who connects. Each user sees the workspaces they have access to in Power BI, and row-level security applies to them. An import reads what the person who starts it can see in Power BI; anyone else who imports connects their own account first.

Your administrator has to set this up first (see [Power BI Data Source Authentication Configuration](/power-bi-data-source-authentication-configuration/)). Until then, **Power BI** is not offered as a data source type.

### Which workspaces you can import from

Only **shared workspaces** are listed: the workspaces created in Power BI for a team, a department or a topic. The personal **My workspace** that every Power BI user has is never listed and cannot be imported from. To import a semantic model that is in My workspace, publish it to a shared workspace first.

You see the shared workspaces you are a member of. To import from a semantic model, you also need the **Build** permission on it, which the workspace roles **Contributor**, **Member** and **Admin** include; **Viewer** alone is not enough.

## When to use it

* Your planning figures live in a Power BI semantic model, and you want them in Valsight without exporting them by hand before every import.
* You need the figures *after* Power BI's modelling and calculations, not the raw data in the database underneath.

Use a JDBC connection instead if the data sits in a database Valsight can reach directly and you need tables over the Power BI limits (see **Good to know**). See [External Data Source Connections (ODATA / JDBC)](/external-data-source-connections-odata-jdbc/).

## Configuration

1. In your project, open **Data Sources** and create a new data source.
2. Set **Data Source Type** to **Power BI** and enter a **Name**.
3. Under **Power BI Access**, click **Connect to Power BI** and sign in with your Microsoft account. You come back to the form, which now shows **Connected as** with your account and lists your workspaces. To use another account, click **Use a different account**.
4. Select the **Workspace**, then the **Semantic Model**.
5. Tick the tables under **Tables to Import**. At least one table is required.
6. Click **Create Data Source**. Valsight imports the selected tables as a background job and shows its progress on the data source page.

To change the selection later, open the data source, adjust the workspace, model or tables, and click **Save and Import Data**. This saves the selection and imports the selected tables again. The data currently in the data source is replaced.

| Setting              | What it does                                                              |
| -------------------- | ------------------------------------------------------------------------- |
| **Power BI Access**  | The Power BI account Valsight reads as: yours, shown as **Connected as**. |
| **Workspace**        | The Power BI workspace that holds the semantic model.                     |
| **Semantic Model**   | The model whose tables are imported.                                      |
| **Tables to Import** | The tables to import. Each becomes a data table with the same name.       |

## Good to know

* **Tables over the Power BI limits are refused, not cut short:** Power BI returns at most 100,000 rows, 1,000,000 values or 15 MB per table, whichever comes first. A table over a limit fails the import with an error naming the table, so you never get a partial table. Split the table in the semantic model, or import the data through JDBC from the database underneath.
* **All selected tables together are also limited:** the installation sets a maximum for the rows of one data source across all its tables, 100,000 by default. Ask your administrator if you need more, or spread the tables over several data sources.
* **A model in "My workspace" never shows up:** your personal workspace is not supported. Publish the model to a shared workspace (see [Which workspaces you can import from](#which-workspaces-you-can-import-from)).
* **Unticking a table deletes its data table on the next import:** the data table, and every `DATA` reference to it, is gone after the next import. Tick the table again and re-import to bring it back.
* **A table renamed or removed in Power BI stays selected and shows in red** with "no longer in the semantic model". The import fails until you untick it or tick its new name.
* **A newly shared workspace or model can take up to two minutes to appear:** Valsight keeps the list it read from Power BI for two minutes. Reload the form after that.
* **You need a Power BI license:** each user needs Power BI Pro or Premium Per User, unless the workspace is on Premium or Fabric capacity.
* **Imports are always started by hand:** Valsight imports a Power BI data source when someone clicks **Create Data Source** or **Save and Import Data**. There are no scheduled imports.
* **Each import reads as the person who starts it:** a colleague who imports the same data source connects their own Power BI account and gets what they can see, which can differ under row-level security.

## Related

* [Power BI Data Source Authentication Configuration](/power-bi-data-source-authentication-configuration/): what an administrator sets up in Microsoft Entra ID, Power BI and Valsight before this data source type is available.
* [External Data Source Connections (ODATA / JDBC)](/external-data-source-connections-odata-jdbc/): the other external data source types.

A Power BI data source is an `ExternalDataSource` with `dataSourceType` `power_bi`. `powerBiWorkspaceId` and `powerBiDatasetId` hold the workspace and semantic model GUIDs. `importTablesFilter` holds the selected table names as a JSON array of strings, for example `["Actuals","Kalender"]`, and must name at least one table. `authenticationType` is required and holds the id of the Power BI client registration the user signs in through; it is accepted on write and never returned on read. The REST API answers a create, or an update that changes it, with a 400 unless it names a Power BI registration users sign in to (authorization\_code). A Power BI data source has no `url`, `username` or `password`. The data source form sets these fields. The REST API also accepts `powerBiWorkspaceId`, `powerBiDatasetId` and `importTablesFilter` on create and update, and never returns them on read.
