> For the complete documentation index, see [llms.txt](https://docs.totallink.nl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.totallink.nl/functioneel-beheer/how-to../module-specifieke-configuratie/datalink-instellen/datalink-power-bi.md).

# Datalink Power BI

Haal data rechtstreeks uit TotalLink op in Power BI via DataLink. Je hebt een URL en een API-key nodig — die ontvang je van de functioneel beheerder.

{% hint style="info" %}
Heb je nog geen URL of API-key? Vraag deze op bij de functioneel beheerder van jullie TotalLink-omgeving.
{% endhint %}

De stappen verschillen afhankelijk van of je Power BI **lokaal** (Desktop) of **online** gebruikt.

{% tabs %}
{% tab title="Power BI Desktop (lokaal)" %}

### Verbinding maken in Power BI Desktop

{% stepper %}
{% step %}

### Get Data openen

Klik op **Get Data** → **Other** → **Web** → kies **Advanced**.

> 📸 **Afbeelding:** Get Data-venster met Other → Web → Advanced geselecteerd
> {% endstep %}

{% step %}

### URL en header invullen

Vul in:

* **URL:** `https://[organisatienaam].datalink.totallink.nl/api/views/[databron-id]`
* Voeg een **Header** toe:
  * Naam: `x-api-key`
  * Waarde: jouw API-sleutel
    {% endstep %}

{% step %}

### Bevestigen

Klik op **OK**.

Power BI voert automatisch de eerste drill-down uit — je ziet de data meteen verschijnen.

> 🎬 **Schermopname:** Doorloop: Get Data → Other → Web → Advanced → URL en header invullen → OK
> {% endstep %}

{% step %}

### Velden uitspreiden

Klik op het **uitklap-icoon** om de velden uit te spreiden als de data nog genest is.
{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="Power BI Online" %}

### Verbinding maken in Power BI Online

In de online versie maak je de verbinding via een zogenaamde *blank query* — een lege query die je zelf invult.

{% stepper %}
{% step %}

### Blank Query openen

Klik op **Create** → **Get Data** → **Blank Query**.
{% endstep %}

{% step %}

### Query invullen

Vervang de standaardtekst in de queryeditor door het volgende (vervang de waarden tussen `[ ]`):

```powerquery
let
  Source = Json.Document(
    Web.Contents(
      "https://[organisatienaam].datalink.totallink.nl/api/views/[databron-id]",
      [Headers = [#"x-api-key" = "[jouw-api-sleutel]"]]
    )
  ),
  #"Converted to Table" = Table.FromList(
    Source,
    Splitter.SplitByNothing(),
    null, null,
    ExtraValues.Error
  )
in
  #"Converted to Table"
```

Klik op **Next**
{% endstep %}

{% step %}

### Credentials bevestigen

Krijg je de melding **'Credentials required'**? Klik op de knop die verschijnt en kies **Configure Connection** en daarna **Connect**.

{% hint style="info" %}
Deze melding is normaal bij de eerste keer verbinden — je hoeft niks extra's in te stellen.
{% endhint %}
{% endstep %}

{% step %}

### Velden uitspreiden

Klik op het **uitklap-icoon** om de velden uit te spreiden.
{% endstep %}
{% endstepper %}
{% endtab %}
{% endtabs %}

{% hint style="success" %}
**Alles werkt correct als** je de velden uit jouw databron ziet verschijnen als kolommen in Power BI.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.totallink.nl/functioneel-beheer/how-to../module-specifieke-configuratie/datalink-instellen/datalink-power-bi.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
