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 / Filter Itens by its Ma...
Power Apps
Unanswered

Filter Itens by its Max Date Recorded

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello everyone,

I'm developing an app in which users can request for company's common resources (Cars, Rooms, Devices, etc) with a feature where they can turn on notifications for that particular resource. That way user can follow every activity concerning the resource they are "following" until the date they use that resource.

However, since they can request a single resource multiple times with multiple start dates, I'm having some trouble in displaying that info in a gallery. Here's an example of my data.

Collection.png


Considering that I'm John, I would like to follow every activity users record for Car A until 5/27/2020 and for Room A until 5/9/2020. However I'm having trouble in finding the maximum date for the specific request.

Here's what I have so far:

 

Filter(ExampleCollection, Name <> "John" && Request exactin Filter(ExampleCollection, Resource = "John").Pick &&
StartDate <= First(SortByColumns(Filter(ExampleCollection, Resource = "John"), "StartDate", Descending)).StartDate

 



Can anyone help me with this?

Thanks in advance  

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,421 Most Valuable Professional on at

    Hi @Anonymous ,

    Try this as the Items of a Gallery

    AddColumns(
     GroupBy(
     ExampleCollection,
     "Resource",
     "DateData"
     ),
     "LastDate",
     First(
     Sort(
     DateData,
     StartDate,
     Descending
     )
     )
    )

    Your names will be

    ThisItem.Resource

    and your latest date

    ThisItem.LastDate.StartDate

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz

    First, thanks for your help. That's was close of what I'm looking for. That Gallery will return me the Max Date recorded for every specific resource but I wanted it that Gallery to be also filtered by the specific person. As an example:

    If I were John, I wanted to retrieve every Record about Car A (excluding my own records) until 5/27/2020 and about Room A until 5/9/2020.

    But If I were Sarah I wanted that list to retrieve me only the records about Car A until 5/3/2020.

    And that's what I've been struggling with.

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@RicardoPereira,

     

    Based on the issue you mentioned, you want to display every activity user's records for CarA & RoomA.

     

    I have a test on my side which needs less formula and easy to achieve.

     

    • Set your gallery Item property like this:Distinct( ExampleCollection, Name)
    • Add your second Gallery named Gallery1, set the Item property like this: First(Sort(Filter(ExampleCollection,Name=BrowseGallery1.Selected.Result),StartDate,Descending))2-2.png

    You can clearly find the maximum date for the specific request.

     

    Best Regards,

    Qi Qiao

  • WarrenBelz Profile Picture
    156,421 Most Valuable Professional on at

    Thanks @Anonymous ,

    If you has the person list in a drop-down (I am only using this as an example) called ddPerson and it was a Choice field, then the gallery Items would be 

    Filter(
     AddColumns(
     GroupBy(
     ExampleCollection,
     "Resource",
     "DateData"
     ),
     "LastDate",
     First(
     Sort(
     DateData,
     StartDate,
     Descending
     )
     )
     ),
     Resource = ddPerson.Selected.Value
    )

     As you requested, this gets the maximum date. The problem you have if you want more records is that anything more than the First() reference I have used for the newest one is returned as a table, which is not able to be displayed in a gallery.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@RicardoPereira,

     

    Based on your further request, I have a modification with my solution.

     

    • Set your gallery Item property like this: Distinct(ExampleCollection,Request)
    • Add your second Gallery named Gallery1, set the Item property like this: First(Sort(Filter('0428',Request=BrowseGallery1.Selected.Result,Name_="John"),StartDate,Descending))

    Best Regards,

    Qi Qiao

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard