Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Ashok1
Regular Visitor

Filtering the PowerApps Visual using Power BI Slicers

Hi All,

 

I have been trying out the new PowerApps Visual in Power BI but have been struggling to understand how to filter an existing App on the Power BI fields (“PowerBIIntegration”).

In this scenario I have:

  1. Created a PowerApp from a SharePoint List. Using the standard template/functionality (which requires very little work) there is a BrowseScreen1, DetailScreen1 and EditScreen1 in the App. This is shown in the first screenshot.
  2. Added the same SharePoint list as a data source in Power BI and expanded the ‘AssignedTo’ field to pull in additional columns.
  3. Created a new Report in Power BI, Imported the PowerApps visual from the marketplace.
  4. Dropped the PowerApps visual onto my report (second screenshot) and added following columns to ‘PowerApps Data’:
    1. FirstName
    2. Title
    3. Priority
    4. Status
    5. Category
  5. Within the visual I then connected to the original PowerApp I created in step 1.
  6. In that PowerApp I now have “PowerBIIntegration”

 

The functionality I would like to achieve is filtering that first BrowseScreen1 based on slicers I would like to use on the Power BI report. Ideally the slicers I would like to use are Assigned To, Priority, Status and Category.

To begin with I have tried filtering on the Assigned To field (third screenshot) however have not had much luck in this area even before trying to filter/slice on multiple fields.

 

Any help moving this forward would be much appreciated.

 

Thanks,

Ashok

 

01_PowerApps_SharePointApp.png02_PowerApps_PowerBIReport.png03_PowerApps_SharePointApp_Filtering.png

1 ACCEPTED SOLUTION

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. 

 

  1. Create a PowerApp from a SharePoint List. Using the standard templates/functionality, there is a BrowseScreen1, DetailScreen1 and EditScreen1 in the App.
  2. 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.
  3. Create a new Report in Power BI, Import the PowerApps visual from the marketplace.
  4. 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)
  5. ​Within the visual connect to the original PowerApp created in step 1.
  6. In PowerBI it will give you the option to edit the PowerApp in PowerApps Studio
  7. In PowerApps studio you will now see "PowerBIIntegration"
  8. Add a new Gallery on the BrowseScreen1
  9. For that Gallery change "Items" to PowerBIIntegration.Data
  10. Change Labels in the new Gallery to the field(s) you would like from the PowerBIIntegration Data.
  11. Delete the:
    • Original Gallery
    • Search Box
    • Refresh Icon
    • Sort Icon
  12. Delete references to these objects, they will be easy to identity as they will now appear with the Yellow warning sign.
  13. Update the OnSelect for the Next Arrow to Navigate to the DetailScreen1
  14. In the DetailScreen1 click on DetailForm and Change the Item source to: First(Filter('Portfolio Issues',ID=Gallery1.Selected.Id))
  15. Delete the trash can
  16. Delete references to this object, they will be easy to identity as they will now appear with the Yellow warning sign.
  17. Update the onSelect field for the Edit Icon by removing the first action – "EditForm(EditForm1);"
  18. In the EditScreen Click on EditForm and Change the Item source to: First(Filter('Portfolio Issues',ID=Gallery1.Selected.Id))
  19. Save and Publish your PowerApp
  20. Back in PowerBI the app will now be updated to your latest version
  21. 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. 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi thank you for this solution - it has partly solved a similar problem that I am facing.

 

Specifically, I am trying to take Filter Context from Power BI to my Data Write Back (Edit Form) Power App. Such that when a user selects a unique value in a Power BI slicer, the Power App will update to reflect this. There is additional complexity in that selections made by the slicer should be written back with other fields in the Power App edit form. For context, the user should always see what the selection is in the Power App, and this should be written back too. 

 

I am currently facing two issues:

 

1. My Power App is connected to the table that I am using for slicer in Power BI (it contains a column with all the possible unique values) I have a gallery that references this table via PowerBIIntegration, and then an edit form which does a LookUp on the gallery. The table connected to the edit form has all the columns for which I want to write back data. Unfortunately, if the value does not exist already in this table, then I cannot filter to it on the Power App. 

 

2. Rather than create a new row in the write back table each time an edit form is submitted the current set up is overwriting on the unique column name.. 

 

Any thoughts or tips on how to move forward would be much appreciated..

v-micsh-msft
Employee
Employee

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.

35.PNG

 

see results:

34.PNG

 

Adding blog for your reference:

Walk through of using the PowerApps custom visual in Power BI

 

Regards,

Michael

 

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. 

 

  1. Create a PowerApp from a SharePoint List. Using the standard templates/functionality, there is a BrowseScreen1, DetailScreen1 and EditScreen1 in the App.
  2. 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.
  3. Create a new Report in Power BI, Import the PowerApps visual from the marketplace.
  4. 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)
  5. ​Within the visual connect to the original PowerApp created in step 1.
  6. In PowerBI it will give you the option to edit the PowerApp in PowerApps Studio
  7. In PowerApps studio you will now see "PowerBIIntegration"
  8. Add a new Gallery on the BrowseScreen1
  9. For that Gallery change "Items" to PowerBIIntegration.Data
  10. Change Labels in the new Gallery to the field(s) you would like from the PowerBIIntegration Data.
  11. Delete the:
    • Original Gallery
    • Search Box
    • Refresh Icon
    • Sort Icon
  12. Delete references to these objects, they will be easy to identity as they will now appear with the Yellow warning sign.
  13. Update the OnSelect for the Next Arrow to Navigate to the DetailScreen1
  14. In the DetailScreen1 click on DetailForm and Change the Item source to: First(Filter('Portfolio Issues',ID=Gallery1.Selected.Id))
  15. Delete the trash can
  16. Delete references to this object, they will be easy to identity as they will now appear with the Yellow warning sign.
  17. Update the onSelect field for the Edit Icon by removing the first action – "EditForm(EditForm1);"
  18. In the EditScreen Click on EditForm and Change the Item source to: First(Filter('Portfolio Issues',ID=Gallery1.Selected.Id))
  19. Save and Publish your PowerApp
  20. Back in PowerBI the app will now be updated to your latest version
  21. 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. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors