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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Unique values shown as...
Power Apps
Answered

Unique values shown as a list

(0) ShareShare
ReportReport
Posted on by 121

I have a staff log where each staff member updates regularly.

 

I'm trying to create a way of seeing how long it has been since each person updated it.

 

I need a list which shows the unique value based on the staff member which is filtered to show the most recent entry.

 

It can't be in a drop down but all visible at the same time.

 

The staff field is the standard created by from sharepoint and the date is saved as RecordDate.

 

Thanks in advance

Categories:
  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @Markswan20 - as I understand it, I think you're trying to create a table of unique values amongst duplicates by the most recent date. Another way to phrase it is that you want to display the latest records in a Gallery amongst duplicates.

    If that is correct, you can try applying the below expression in the Items property of a Gallery:

     

    ForAll(
     GroupBy(
     'Your Data',
     "The field which contains duplicates",
     "_items"
     ),
     First(
     Sort(
     _items,
     Modified,
     SortOrder.Descending
     )
     )
    )

     

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

  • Markswan20 Profile Picture
    121 on at

    Thank you Amik

  • Markswan20 Profile Picture
    121 on at

    I've hit a snag, i want the filter to utilise the default field ThisItem.'Created By'.DisplayName

    I have imported this into the galley but the coding kicks up error.

     

    This is the current code

     

    ForAll(GroupBy(Command,"'Created By'.DisplayName","_items"),First(Sort(_items, RecordDate, SortOrder.Descending)))

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    Hi @Markswan20 ,

     

    GroupBy is not supported on complex field types. Use AddColumns to store the complex field attribute (in this case, the Display Name) as a new "virtual" column.

     

    ForAll(
     GroupBy(
     AddColumns(
     Command,
     "CreatedDisplayName",
     'Created By'.DisplayName
     ),
     "CreatedDisplayName",
     "_items"
     ),
     First(
     Sort(
     _items,
     RecordDate,
     SortOrder.Descending
     )
     )
    )

     

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard