# Using the Power BI integration in a Metric

This guide explains how to map fields in the Smaply form to Power BI datasets and display the data as a chart.

<figure><img src="/files/GikEKUqCpUmU8kDWYPlU" alt=""><figcaption></figcaption></figure>

### Steps to Add a Power BI Metric

1. **Open the Add Metric Form**
   * Navigate to the **Metrics** section in Smaply.
   * Click **Add Metric** to open the form.
2. **Fill in the Form Fields**
   * **Name:** Choose a meaningful name for your metric (e.g., *Employee count by city*).
   * **Source:** Select **Power BI**.
   * **Type:** Right now we support series charts
   * **Workspace:** Select the appropriate Power BI workspace where your dataset is located.
   * **Dataset:** Choose the dataset that contains the relevant data.
   * **Table:** Enter the table name from Power BI and click **Enter** to load the available fields.
   * **Data Label:** Select the column that represents the **categories** (e.g., *City*).
   * **Data Value:** Select the column that represents the **values** to measure (e.g., *Value*).
3. **Save and Display the Metric**
   * Click **Save** to store the metric.
   * The metric will now be visualized as a chart in your dashboard.

### Understanding Field Mapping Between Smaply and Power BI

<figure><img src="/files/BSmfHxXZCA2mcUaQniXX" alt=""><figcaption></figcaption></figure>

| Smaply Field   | Power BI Equivalent                                           |
| -------------- | ------------------------------------------------------------- |
| **Workspace**  | Power BI Workspace                                            |
| **Dataset**    | Power BI Dataset                                              |
| **Table**      | Table in Power BI Dataset                                     |
| **Data Label** | Column representing categories (e.g., *City*)                 |
| **Data Value** | Column representing numerical values (e.g., *Employee Count*) |

### Troubleshooting

* If no datasets or tables appear, ensure that the selected Power BI workspace contains the required data.
* Check permissions in Power BI to verify that the service account has access to the selected dataset.
* If the metric does not display correctly, confirm that the **Data Label** and **Data Value** fields are mapped correctly to Power BI columns.

By following these steps, you can seamlessly integrate Power BI data into Smaply metrics and visualize key insights effortlessly.


---

# Agent Instructions: 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:

```
GET https://helpdesk.smaply.app/integrations/metrics-tools/powerbi/using-the-power-bi-integration-in-a-metric.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
