cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ChrisSullivan
Helper III
Helper III

Filtering Galley to not show multiple items with the same person in the person column (SharePoint)

Hello Wizards, 

I am stumped, and I know you guy have the answer I need. 
I have a gallery that I am trying to show Sharepoint list items on. The items can have the same Users choosen for the people picker column. I want to only show the lastest created item for that user in the gallery. 

Example:
Item1: ID=1 People picker=Chris Created= 8/11/2022
Item2: ID=2 People picker=Chris Created= 8/10/2022

Item3: ID=3 People picker=Chirs Created= 8/09/2022

 

I only want the gallery to show the John lastest item from the list. This is where I got so far, but I cant seem to get Distinct() to work.

 

SortByColumns(
        AddColumns(
            'Veeva eTMF Access',
            "User DisplayName",
            'Internal User'.DisplayName
        ),
        "User DisplayName",
        Descending
    )

 

This is working as seen below but I need only the lastest Item for Chris to be selecte here because it has the most recent data in it

ChrisSullivan_0-1660248424971.png

After I figure this out then I also need to filter this furthur by some other column values. Lets say a column that has three choices, and I  only want to show items that have choice 1. 

 

Thanks guys!

1 ACCEPTED SOLUTION

Accepted Solutions
BCBuizer
Super User
Super User

Hi @ChrisSullivan ,

 

I think the below should do the trick:

ForAll(
    Distinct(
        'Veeva eTMF Access',
        'Internal User'.DisplayName
    ),
    LookUp(
        Sort(
            'Veeva eTMF Access',
            Created,
            Descending
        ),
        'Internal User'.DisplayName = Result
    )
)

 

 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

View solution in original post

1 REPLY 1
BCBuizer
Super User
Super User

Hi @ChrisSullivan ,

 

I think the below should do the trick:

ForAll(
    Distinct(
        'Veeva eTMF Access',
        'Internal User'.DisplayName
    ),
    LookUp(
        Sort(
            'Veeva eTMF Access',
            Created,
            Descending
        ),
        'Internal User'.DisplayName = Result
    )
)

 

 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,456)