Skip to main content

Notifications

Power BI - How to embed a PBIX in D365FO and add in a workspace.

Ajit Profile Picture Ajit 8,755

We have an option in D365 to embed PowerBI visuals and run through workspaces. Here I am providing steps to do the same.

1. Create a PowerBI report using power BI desktop and save the file, .pbix file will be saved.  You can refer below youTube tutorial

2. Open Visual Studio in your dev box and Right click on your project - Add - New Item 

1.jpg

3. Create a new 'Resource' and give the name of that resource.

2.jpg

4. As soon as you hit the ok, VS will popup the file explorer to select the 'PBIX' file, select the pbix you have developed\created.

3.jpg

5. Hit 'ok', resource will get created in your project.

4.jpg

6. Create a Display Menu Item 'demoAddPowerBiDisplay' and also create a controller class 'demoAddPowerBIWorkSpaceController' and extends with 'PBIReportControllerBase'

Note - You can copy the standard controller class like - 'FinancialInsightsWorkspaceEmbeddedController' 

5.jpg

7. Now add or modify the 'Main' method of the class and call your pbix resource -

6.jpg

8. Add this controller class in your menu item as an object.

9. Now create a new 'Tile' Right click on your project -> Add -> new Items -> User Interface - Tile.

10 . Once created, select your display menu item in tile properties. And give the label.

7.jpg

11. Add this tile to your menu.

8.jpg

12 - Once you click on this workspace, your pbix will get called. 

9.jpg

Tags: #PowerBI #D365FO #Pbix #Dynamics 

Comments

*This post is locked for comments

  • Ajit Profile Picture Ajit 8,755
    Posted at
    Hello Guys - I tried on tier 2 F&O environment. To get this work in tier1 (one box) VM, you would have to do some update in web.config and all. onedrive.live.com/ If you are getting failed to publish report error in tier 2 instance, below are some points you would want to verify 1. Preview features are not used in your PBIX 2. Make sure you are using 'Dynamic Query' not import mode for loading data 3. If you have renamed columns, make sure columns name are duplicate
  • JeffGreenrc Profile Picture JeffGreenrc
    Posted at
    Hi, On which VM you performed above steps i.e. cloud hosted or local vhd or sat vm? Thanks
  • ARavenna Profile Picture ARavenna
    Posted at
    Hi, Great article. I follow your steps, but when I try to run my report, I have de error: "Failed to publish Power BI Embedded report MyReport" in PreProd. Any idea? I need de deploy de report? The report runs well when I use it in PowerBi Desktop. Thank you.