# Embedded Power BI - Form

## Use Case

Hi, How are you?

Thank you for your reading. Yesterday, I got a reporting requirement from the client.

&#x20;  I was thrilled when they wanted to know **how we could make the 360 Customer view more insightful**. And I told them we could make the Power BI tool with more data visualization, more analytics to create a comprehensive and engaging report that would reveal the customer's 360 view.&#x20;

&#x20;  So, I designed a sample Power BI report that displays the customer's demographics, loan and contract details, and customer care data. Then, I embedded this Power BI in the main form of the table. The Power BI report will be set as the filter by the current customer.\
&#x20;   Creating and displaying a visualization in the Main form using OOB components in Dataverse is very challenging. That's why I opted for the Embedded Power BI solution. :relaxed:

## Embedded Power BI report on Form

{% hint style="success" %}
Microsoft reference link: [Embed a Power BI report in a model-driven app main form](https://learn.microsoft.com/en-us/power-apps/maker/model-driven-apps/embed-powerbi-report-in-system-form)   &#x20;
{% endhint %}

My steps below and I used the app [**Power BI Embedder**](https://www.xrmtoolbox.com/plugins/Fic.XTB.PowerBiEmbedder/) in XrmToolbox to embed the Power BI report in the Main form.

<figure><img src="/files/HgIMomvwoz2TGvRSQchs" alt=""><figcaption><p>Involved Steps</p></figcaption></figure>

&#x20;  For instance, I have a report called **"FE\_Poc" -** that displays the customer's demographics, loan and contract details, and customer care data. I will embed this report in the Main form of the **Contact** table. The report will be **filtered** by **CustomerID** (a field on the Contact table).

### 1.1 Add filtering for the Power BI report

In the report, expand the **Filter** **>>** then add the field **CustomerID** under the section **"Filter on all pages" >>** then Save and Public report to Power BI Service.

{% hint style="info" %}
With this filtering, all pages of this report will be filtered by **CustomerID.**
{% endhint %}

<figure><img src="/files/ui5utB8CWLpyinCk4kIR" alt=""><figcaption><p>Add filtering for PwBI report</p></figcaption></figure>

The next step, I opened my **Solution** >> opened main form **Contact:**

* I added a new tab called **Power BI**&#x20;
* Then, I added a new section **FE\_Poc** in this tab.

I will embed the Power BI report into the section **FE\_Poc** under the **Power BI** tab.

<figure><img src="/files/gUZ0joh4K9WXAMRlcu6b" alt=""><figcaption><p>Tab &#x26; Section for embedded Power BI</p></figcaption></figure>

### 1.2 Using XrmToolbox to embed the Power BI report

Now, open the [**XrmToolbox**](https://www.xrmtoolbox.com/) >> then use the app [**Power BI Embedder**](https://www.xrmtoolbox.com/plugins/Fic.XTB.PowerBiEmbedder/)**.**

Firstly, I need to find the **Group ID** and **Report ID** of the Power BI report **"FE\_Poc"** for the configuration in the XrmToolBox

<figure><img src="/files/TfGcgqYufmlMTX5b4M1E" alt=""><figcaption><p>How to find Group ID and Report ID</p></figcaption></figure>

Configuration on the app **Power BI Embedder:**

1. **Target** section:
   * *Entity*: choose entity **Contact**
   * *Form*: choose the main form needed to embed the Power BI report
   * *Tab*: choose the tab on the main form
   * *Section*: chose section on the main form
2. **Power BI Config** section:
   * *Method:* set default value - ***Manual***
   * *Group ID:* input the Group ID value of the Power BI report (above)\
     My sample: *<mark style="color:red;">52b0871f-948e-41d8-97cb-0375566b7dd5</mark>*
   * *Report ID:* input the Group ID value of  the Power BI report (about)\
     My sample: *<mark style="color:red;">6781e570-7f4d-400a-8231-c5ab898621a7</mark>*
   * *Page*: input the value [https://app.powerbi.com/reportEmbed?reportId=](https://app.powerbi.com/reportEmbed?reportId=6781e570-7f4d-400a-8231-c5ab898621a7)***\[\[ReportID]]***\
     Sample: My Report ID = *<mark style="color:red;">6781e570-7f4d-400a-8231-c5ab898621a7</mark>*\
     \&#xNAN;***-> Page:*** [https://app.powerbi.com/reportEmbed?reportId=](https://app.powerbi.com/reportEmbed?reportId=6781e570-7f4d-400a-8231-c5ab898621a7)*<mark style="color:red;">6781e570-7f4d-400a-8231-c5ab898621a7</mark>*
   * *URL*: input the value [*https://app.powerbi.com*](https://app.powerbi.com)\
     *---*
   * Tick the field **Filter** -> to enable pre-filtering for the Power BI report. \
     The filtering configuration is below:
     * *<mark style="color:green;">PBI Table:</mark>* select Power BI Dataset which contains the field **"Customer ID"&#x20;*****(used for pre-filtering).***
     * *<mark style="color:green;">PBI Column</mark>*: select a column in the Power BI Dataset used for filtering (in Filter Pane).
     * *<mark style="color:green;">CDS Field:</mark>* select a column of the table **Contact** in Dataverse. This column will be used to filter the Power BI report.

<figure><img src="/files/U1kmLlV9Taopt1Yib8nh" alt=""><figcaption><p>Configuration - Power BI Embedder - Publish</p></figcaption></figure>

Finally, just click **Publish Report** to finish and wait.... :tada:

## Checking now\...

Open a Contact - **A Nguyễn Văn (CustomerID = C000001)** -> The Customer ID auto filterred.

<figure><img src="/files/Nwe2e3m4x72yx7dXZecS" alt=""><figcaption><p>Check first contact</p></figcaption></figure>

... and I check for another contact...

<figure><img src="/files/9S8njurEblnVvQiH2ebR" alt=""><figcaption><p>Live check</p></figcaption></figure>

Yeah... with XrmToolbox, embedded the Power BI report so easily. \
Thank **XrmToolbox**, thanks **Ivan Ficko** author of Power BI Embedder app.&#x20;

Thank you and hoping well... :tada:\
\&#xNAN;**\[NTD]yns.asia**                                                                                                                         &#x20;


---

# 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://dyns.ntd.asia/power-dynamics/power-platform/model-driven-app/embedded-power-bi-form.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.
