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

# absentify Power BI connector documentation

> Unlock powerful analytics capabilities with the absentify Power BI connector. Tailored for HR admins to efficiently manage and analyze absence trends.

Interested in analyzing data trends to optimize operations or efficiently handle employee absences? As an HR admin, this integration empowers you to unlock actionable insights from absence data and enhance operational decision-making.

With the Microsoft Power BI Connector offered by **absentify**, you can elevate how you analyze absence planning and internal scheduling.

<Info>
  **Important:** This feature is available exclusively in the Plus plan. Check our [Plans and Pricing](https://absentify.com/pricing) to explore how absentify can maximize your data analysis capabilities.
</Info>

***

## Why use the Power BI connector?

The Power BI connector allows you to:

* Visualize absence trends to identify areas for improvement.
* Create dashboards tailored to your organization's needs.
* Integrate absence data seamlessly into broader business intelligence workflows.

<Note>
  The custom connector (`.mez`) supports manual data refreshes only — scheduled refreshes in the Power BI Service are not available for it. To schedule automatic refreshes, use the [direct API integration](#using-direct-api-requests) below, which **does** work with Power BI Service scheduled refresh.
</Note>

***

## Quick start guide

### Installing the connector

1. **Download the custom connector**
   * Get the **absentify Power BI Custom Connector (.mez)** file here: [Download link](https://braincoresolutions-my.sharepoint.com/:u:/g/personal/marc_absentify_com/EdDqVoc9DF5CiCpJmhId-MAB9zt4YHFbElMrkYkEBCmy9Q?e=HqqaRt)

2. **Save the file**
   * Place the `.mez` file in the folder:
     ```
     Documents\Power BI Desktop\Custom Connectors
     ```
   * If this folder doesn’t exist, create it manually.

3. **Enable Power BI Desktop to use custom connectors**
   * Open **Power BI Desktop**.
   * Navigate to `File > Options and Settings > Options`.
   * In the left menu, select **Security**.
   * Under **Data Extensions**, select:
     * **Allow any extension to load without validation or warning**.
   * Select **OK** and restart Power BI Desktop.

***

### Configuring absentify for integration

1. **Generate an API key**
   * Sign in to absentify.
   * Go to `Settings > Integrations > API Key`.
   * Generate a new API key and save it securely for later use.

2. **Connect Power BI to absentify**
   * In Power BI Desktop, go to `Home > Get Data`.
   * Scroll to **Other** and select **absentify**.
   * Enter the API key when prompted.

***

## Using direct API requests

For automation and advanced queries, you can integrate Power BI directly with the absentify API using Power Query.

<Note>
  For these queries to refresh in the Power BI Service (not just Power BI Desktop), always pass `https://api.absentify.com` as the static base URL and put the endpoint path in `RelativePath` and parameters in `Query`, exactly as shown below. A fully dynamic URL works in Desktop but fails on the Service. See [Automating data refreshes](#automating-data-refreshes).
</Note>

### Example: fetching members data

```m theme={null}
let
    apiKey = "your_api_key_here",
    response = Web.Contents(
        "https://api.absentify.com",
        [
            RelativePath = "api/v1/members",
            Headers = [ #"X-API-KEY" = apiKey ]
        ]
    ),
    jsonResponse = Json.Document(response),
    responseTable = Table.FromList(jsonResponse, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    expandedTable = Table.ExpandRecordColumn(responseTable, "Column1", {"id", "name", "email"})
in
    expandedTable
```

### Example: fetching requests per day

```m theme={null}
let
    apiKey = "your_api_key_here",
    response = Web.Contents(
        "https://api.absentify.com",
        [
            RelativePath = "api/v1/requests_per_day",
            Query = [
                start = "2024-01-01T00:00:00Z",
                end = "2024-01-31T23:59:59Z",
                status = "APPROVED"
            ],
            Headers = [ #"X-API-KEY" = apiKey ]
        ]
    ),
    jsonResponse = Json.Document(response),
    responseTable = Table.FromList(jsonResponse, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
    responseTable
```

***

### Automating data refreshes

Unlike the custom connector, the direct API integration **does** support scheduled refresh in the Power BI Service. Two things are required:

1. **Keep the base URL static.** Always pass `https://api.absentify.com` as the first argument to `Web.Contents` and put the endpoint path in `RelativePath` (and parameters in `Query`), exactly as in the examples above. A fully dynamic URL works in Power BI Desktop but fails on the Service with credential/firewall errors.
2. **Set the data source credential to *Anonymous*.** After publishing, open **Dataset → Settings → Data source credentials**, edit the credentials for `https://api.absentify.com`, and select **Anonymous**. The API key travels in the `X-API-KEY` header, so do **not** select OAuth2, Basic, or Organizational account — those fail with an OAuth error (`DMTS_OAuthFailedToGetResourceIdError`).

Once both are set, configure your refresh schedule as usual under **Dataset → Settings → Scheduled refresh**.
