How to integrate Power BI visuals into PowerApps
PowerApps is the perfect compliment to Power BI in that it makes it very easy to update or add data to the underlying datasets that Power BI is Visualizing.
This walk through is using the Dashboard in a day sample data that can be found here: https://aka.ms/DIAD To make it easier i am starting with the finished version of the report
Step 1. Open the Dashboard in a Day finished report
In PowerBi.com login and select Get Data > Files and navigate to where you downloaded and extracted the Dashboard in a Day samples. In this example i am using a workspace called “Difinity”; as the intent is to share this PowerApps application, you would not want do this from “My Workspace”
Step 2. Pin a visual from the Power BI report to a Dashboard
As the PowerApps Power BI control only supports visuals in Dashboards, we need to pin one of the visuals to a dashboard, in this case I am creating a new one called “PATutorial”.
Step 3. Create a Canvas based PowerApp
Step 4. Insert a Power BI Control
From the insert ribbon choose controls and scroll to the Power BI Tile
Step 5. Setup the Power BI Control
Step 6. Add some buttons to set the filter context
On the Insert ribbon select controls and add a couple (~three) buttons. Change their Text to that of the
manufacturers in the Dash board in a day sample i.e. VanArsdel, Natura and Prium.
Step 7. Create and set a variable to used as our filter context
In the OnSelect of each button set a variable to the manufacture name. In this example we are hard coding the values rather than using the Button1.Text property to make it easier to include the needed single quotes around the manufacturer name.
Set(MyManufacture,”‘VanArdel'”)
Step 8. Set the TileURL property of the Power BI Control
Select the Power BI control and scroll to the TileURL property then add the section in purple below. If your buttons don’t work there is a good chance you have added an extra space in the URL and the filter is being ignored.
“HTTPS://APP.POWERBI.COM/EMBED?DASHBOARDID=18AAEA96-CC77-45D6-BC72-19876656C513&TILEID=1FF09934-DB7E-... &$filter=Manufacturer/Name eq ” & MyManufacture
Congrats you have now created a PowerApp that is hosting a Power BI Tile!
Some notes with this example:
If you are looking at the Power BI documentation note there are differences!
https://docs.microsoft.com/en-us/power-bi/service-url-filters
- myvar should start with “&” instead of “?” (because there are other URL params ahead of it)
- “filter” should be “$filter” (unlike in Power BI directly)
The Tile URL may look something like the following:
and your Button OnSelect would have something like the following:
Set(myvar, "&$filter=Store/Territory eq 'NC'")
To watch a video of this from end to end please see:
Comments
-
How to integrate Power BI visuals into PowerApps
I found the answer!
Apparently there is a "new" property of the Power BI Tile in Power Apps called: AllowNewAPI. Setting the value to true allows the filters to work properly.
Hope someone else finds this useful!
-
How to integrate Power BI visuals into PowerApps
Hi Everyone,
Does anyone know if these requirements have changed? I have tried everything I can think of to get this to work with no success. As Dave and ssmolen have posted, I have also pinned from the Reports Pin Visual control and filtering is still not working in Power Apps. But yet, I can filter the report using the URL without issue. In Power Apps when clicking a button to filter the Power BI Tile, it flickers for a second, but the data displayed does not change.
Any updates would be greatly appreciated!
-
How to integrate Power BI visuals into PowerApps
@DaveMeier, Is that your update on your solution?
-
How to integrate Power BI visuals into PowerApps
@chass do you know if this still works? Similar to Dave, I've been struggling to apply any sort of filtering to the PowerApps Power BI tiles, although it still works great on the underlying report.
Update: managed to resolve my issue. It turns out that filtering only works on Tiles created directly from Reports via the "Pin visual" control, but not from Tiles included in Dashboards created via the "Pin Live Page" control.
-
How to integrate Power BI visuals into PowerApps
I am unable to make the Filter parameter work in PowerApps as described in this article. I am able to filter the underlying report by adding the Filter to the report URL. Does filtering a PowerBI tile in PowerApps still work?
Update:
It works for me now. Thanks to the following post by @ssmolen! "It turns out that filtering only works on Tiles created directly from Reports via the "Pin visual" control, but not from Tiles included in Dashboards created via the "Pin Live Page" control."
*This post is locked for comments