Forum Discussion
Filtering the PowerApps Visual using Power BI Slicers
- 8 years ago
Thank you Michael v-micsh-msft.
I have done some more testing on this and found a way to achieve the desired outcome.
The steps below are fairly straightforward, uses the standard PowerApps template for SharePoint (with some modifications) and is context sensitive to the slicers and selections made on the PowerBI report including Person fields.
- Create a PowerApp from a SharePoint List. Using the standard templates/functionality, there is a BrowseScreen1, DetailScreen1 and EditScreen1 in the App.
- Add the same SharePoint list as a data source to a Power BI Report, edit the data source query and expand the 'AssignedTo' field (or any other Person field) to pull in additional columns.
- Create a new Report in Power BI, Import the PowerApps visual from the marketplace.
- Drop the PowerApps visual onto the report and add the following columns to 'PowerApps Data':
- FirstName (from the AssignedTo field)
- Title
- Priority
- Status
- Category
- ID (this is important as it will be used to link to the original SharePoint list)
- Within the visual connect to the original PowerApp created in step 1.
- In PowerBI it will give you the option to edit the PowerApp in PowerApps Studio
- In PowerApps studio you will now see "PowerBIIntegration"
- Add a new Gallery on the BrowseScreen1
- For that Gallery change "Items" to PowerBIIntegration.Data
- Change Labels in the new Gallery to the field(s) you would like from the PowerBIIntegration Data.
- Delete the:
- Original Gallery
- Search Box
- Refresh Icon
- Sort Icon
- Delete references to these objects, they will be easy to identity as they will now appear with the Yellow warning sign.
- Update the OnSelect for the Next Arrow to Navigate to the DetailScreen1
- In the DetailScreen1 click on DetailForm and Change the Item source to: First(Filter('Portfolio Issues',ID=Gallery1.Selected.Id))
- Delete the trash can
- Delete references to this object, they will be easy to identity as they will now appear with the Yellow warning sign.
- Update the onSelect field for the Edit Icon by removing the first action – "EditForm(EditForm1);"
- In the EditScreen Click on EditForm and Change the Item source to: First(Filter('Portfolio Issues',ID=Gallery1.Selected.Id))
- Save and Publish your PowerApp
- Back in PowerBI the app will now be updated to your latest version
- In Power BI add the slicers you would like, this can include fields from AssignedTo. You should now see the items respond to your slicers selections.
Hopefully the steps above help anyone else looking to achieve a similar outcome.
Assigned to field is a people or group field, which currently is not supported for delegation in PowerApps when using this field with filter functions (and it is a little complicated to write the filter in your scenario ).
And currently Power BI and PowerApps handles the Person or group field differently. There is no option that I am aware of to make them work together.
Basically, if you would like to fitler the Gallery, it is recommended to take use of text or number type column, the formula for items property of the Gallery should be as below (please edit the App by clicking the PowerApps Visual Edit option at the top right):
Filter(SharePointList, Title in PowerBIIntegration.Data.Title)
Which should be able to show you the filtered results under PowerApps visual.
see results:
Adding blog for your reference:
Walk through of using the PowerApps custom visual in Power BI
Regards,
Michael
- Ashok18 years agoAdvocate I
Thank you Michael v-micsh-msft.
I have done some more testing on this and found a way to achieve the desired outcome.
The steps below are fairly straightforward, uses the standard PowerApps template for SharePoint (with some modifications) and is context sensitive to the slicers and selections made on the PowerBI report including Person fields.
- Create a PowerApp from a SharePoint List. Using the standard templates/functionality, there is a BrowseScreen1, DetailScreen1 and EditScreen1 in the App.
- Add the same SharePoint list as a data source to a Power BI Report, edit the data source query and expand the 'AssignedTo' field (or any other Person field) to pull in additional columns.
- Create a new Report in Power BI, Import the PowerApps visual from the marketplace.
- Drop the PowerApps visual onto the report and add the following columns to 'PowerApps Data':
- FirstName (from the AssignedTo field)
- Title
- Priority
- Status
- Category
- ID (this is important as it will be used to link to the original SharePoint list)
- Within the visual connect to the original PowerApp created in step 1.
- In PowerBI it will give you the option to edit the PowerApp in PowerApps Studio
- In PowerApps studio you will now see "PowerBIIntegration"
- Add a new Gallery on the BrowseScreen1
- For that Gallery change "Items" to PowerBIIntegration.Data
- Change Labels in the new Gallery to the field(s) you would like from the PowerBIIntegration Data.
- Delete the:
- Original Gallery
- Search Box
- Refresh Icon
- Sort Icon
- Delete references to these objects, they will be easy to identity as they will now appear with the Yellow warning sign.
- Update the OnSelect for the Next Arrow to Navigate to the DetailScreen1
- In the DetailScreen1 click on DetailForm and Change the Item source to: First(Filter('Portfolio Issues',ID=Gallery1.Selected.Id))
- Delete the trash can
- Delete references to this object, they will be easy to identity as they will now appear with the Yellow warning sign.
- Update the onSelect field for the Edit Icon by removing the first action – "EditForm(EditForm1);"
- In the EditScreen Click on EditForm and Change the Item source to: First(Filter('Portfolio Issues',ID=Gallery1.Selected.Id))
- Save and Publish your PowerApp
- Back in PowerBI the app will now be updated to your latest version
- In Power BI add the slicers you would like, this can include fields from AssignedTo. You should now see the items respond to your slicers selections.
Hopefully the steps above help anyone else looking to achieve a similar outcome.