this time I will share a little bit of stuff that I am missing in Dynamics 365 Business Central – Power BI fact box on various lists.
The goal was to include Power BI Report FactBox on the “Chart of Accounts” list page and to maybe be able to enable contextual filtering.
With standard Dynamics 365 Business Central you can enable Power BI Report FactBox on the following pages
- List pages (customer, vendor, items)
- RoleCentar pages
Example of Power BI FactBox embedded into the Item list page
Example of Power BI Embedded into the RoleCenter page
And now my challenge was how can I have embedded Power BI FactBox on the different pages where this is not available.
As a start, I first created one PageExtension that extends the “Chart of Accounts” page. In that PageExtension I added the next fact box called “Power BI Report FactBox”. Same way how it was done on the for example Customer Lists page.
That was a good start, as now I can embed Power BI reports on my “Chart of Accounts” page. The next step was digging into standard objects like Customer List for ideas. And first what I saw was that I need to initialize Power BI FactBox. This is very useful because in this case, you will control only this specific Power BI FactBox on the “Chart of Accounts” page. Any modification like enabling/disabling Power BI reports on the “Chart of Accounts” will not have an impact on other list pages or role center pages where Power BI Fact Box is used.
What that part of code will also bring is that now my Power BI Reports will be filtered by page name.
Now when I can enable Power BI reports only for this list page, I want to enable contextual filtering. This means that my users will pass a filter to the Power BI report when selecting a specific record on the list page, and the Power BI report will be filtered with the selected value. This can be done with the following lines of code.
And now I can use my Power BI Report Fact Box on a new page.
I hope that I gave you an idea of how you can utilize this code and have a Power BI Report Fact Box on different pages.
Renato 🙂Tags: Dynamics 365 Business Central PowerBI