web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Collect list without d...
Power Apps
Answered

Collect list without duplicates

(0) ShareShare
ReportReport
Posted on by

Hi,

I have a list that looks like this:

Column1Column2Column3Column 4
AText1aaa...
AText2bbb.....
AText3ccc...
B(blank)ddd...
C(blank)eee....

 

I need to create a collection that eliminates duplicates on Column1 and keeps Column3 and 4. 

Distinct() only returns one column (Column1) so I'm unsure how to proceed to add the rest of the columns... 

 

FInal result on the example would be: 

Column1Column3Column 4
Accc...
Bddd...
Ceee....

 

Additional info:

Column3 is blank if Column1 does not have duplicates. As column3 are options for column1. 

When populated, Column3 has no duplicates. 

 

Thanks and regards

 

The issue is the same as: https://powerusers.microsoft.com/t5/General-Discussion/how-to-remove-duplicates-from-collection/td-p/20106

but that post is 2 years old, so hope there is a solution for that now

Categories:
I have the same question (0)
  • Verified answer
    RezaDorrani Profile Picture
    12,143 on at

    Hi @Anonymous 

     

    Group By would be your best bet to get distinct records of Column1 and it will give you sub records which would include all the values/rows associated with Column 1 in a table

     

    Second option would be to use the following to get the output sample you provided

     

    ForAll(Distinct(DataSource,Column1),Collect(colNew, Last(Filter(DataSource,Column1=Result))))

     

    ColNew would give you the result

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard