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
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.
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 )