Power Apps Filter Gallery

It is common to want to filter your gallery to remove duplicate values but at some point, you may want to only show the duplicate items. In this article, We will show you how to within power Apps, Filter your Gallery to only show duplicate items.

Power Apps Filter Gallery to Only Show Duplicate Values

Example Scenario-

An Asset management app has been created with a Gallery that points to a SharePoint list, Asset database. All users should only have one type of asset assigned to them for example a laptop or mobile phone.  A filter is to be created to only see records if a user has a duplicate Asset type of mobile phone with the status of assigned. A dropdown is created at the top of the page with the filter option.

Power Apps Filter Gallery

Solution –

Use the below as the items property for the Gallery


If(Dropdown1.Selected.Value = ‘Duplicate Laptops’,

Filter(
   AddColumns(
      GroupBy(
         Filter(
         'Asset Database', 
            'Asset Type = "Laptops" && 
            Status.Value = "Assigned"
         ),
         "YourUserFieldName"
         "Data"
      ),
      "Duplicates",
      CountRows(Data)
   ),
   Duplicates > 1
)

Leave a Reply

Your email address will not be published. Required fields are marked *