# Connect Microsoft Power BI

Lumicast can read values out of a Power BI **semantic model** (formerly called a dataset) and bind them onto your [pages](/features/page-editor). A KPI in a corner, a top-ten table, a target versus actual: whatever a DAX query can return.

::: info This is data, not a dashboard
This connection brings **values** into Lumicast so you can style them yourself. It does not embed a Power BI report or dashboard as a picture. Designing the numbers into your own page usually reads far better at viewing distance than a full dashboard scaled onto a display.
:::

## Requirements

Three things have to be true before the connection works, and two of them are your Power BI administrator's call:

- A **Microsoft account with a Power BI Pro licence** (or a workspace on Premium/Fabric capacity) that has **read and build** permission on the semantic model you want to query. A dedicated signage account is safer than a personal one.
- The tenant setting **Dataset Execute Queries REST API** must be **enabled**. It lives in the Power BI admin portal under *Tenant settings > Integration settings*. Without it every query fails, no matter how the connection is set up.
- The account must be able to sign in **without an interactive prompt on every renewal**. If Conditional Access forces periodic re-authentication, the connection will keep expiring and need reconnecting by hand.

## 1. Create the connection and data source

1. Go to **Data Sources** and click **New data source**.
2. Choose **Microsoft Power BI**, then **Power BI query**.
3. When prompted, **connect your Microsoft account** and accept the consent prompt. Lumicast requests read-only access to your workspaces and semantic models.
4. Pick the **Power BI workspace**. Only workspaces the connected account belongs to appear, plus **My workspace** for that account's personal content.
5. Pick the **Semantic model**.
6. Paste a **DAX query** (see below).
7. Save. Lumicast starts polling and stores the latest result.

## 2. Writing the DAX query

The query field takes one DAX statement, starting with `EVALUATE`. A single KPI is a one-row table:

```dax
EVALUATE ROW("Revenue", [Total Revenue], "Target", [Revenue Target])
```

A list to bind to a repeating [group](/features/binding-data#binding-a-group-to-a-list):

```dax
EVALUATE
TOPN(
    10,
    SUMMARIZECOLUMNS(
        Product[Name],
        "Sales", [Total Sales]
    ),
    [Sales], DESC
)
```

::: tip Let Power BI Desktop write it for you
You don't have to author DAX from scratch. In Power BI Desktop, open **View > Performance Analyzer**, click **Start recording**, refresh the visual showing the numbers you want, then expand that visual's entry and choose **Copy query**. Paste the result straight into Lumicast.
:::

The preview panel runs the query as you configure it, so you can see the exact rows before saving.

## 3. Binding the result

Field names come back exactly as Power BI names them, so a model column appears as `Sales[Revenue]` and a column your query created appears as the name you gave it. Pick them from the `/` menu inside any text layer, as described in [Binding Live Data to Pages](/features/binding-data).

## All configuration options

| Setting | Explanation | Required |
|---|---|---|
| Power BI workspace | Which workspace to browse for models | **Yes** |
| Semantic model | The model the query runs against | **Yes** |
| DAX query | One `EVALUATE` statement | **Yes** |

## Limits

Power BI caps what one query can return:

- 100,000 rows, or 1,000,000 values, whichever comes first
- 15 MB per query
- 120 queries per minute across all data sources using the same account

Signage queries are normally far below all three. If you hit them, aggregate more in the query rather than pulling raw rows.

## Troubleshooting

**"Power BI refused the request"**: almost always the *Dataset Execute Queries REST API* tenant setting being off, or the account lacking **build** permission on the model. Both need someone with Power BI admin or model ownership.

**The connection keeps expiring**: the account is likely subject to a Conditional Access policy that requires interactive sign-in. Ask your Microsoft administrator to exclude the signage account, or use one that isn't covered.

**"DAX Evaluate queries work only on databases which have at least one table"**: the semantic model you picked is empty. Power BI rejects every query against a model with no tables, even one that only returns constants. Upload a file to the model first, then re-pick it.

**Models are missing from the list**: the connected account can only see workspaces it is a member of. Add it to the workspace in Power BI, then reload the data source form.

**Row-level security**: models with RLS applied return data as the connected account sees it. Everyone looking at the display sees that account's slice, so pick the account accordingly.
