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 / Gallery Filter - Only ...
Power Apps
Answered

Gallery Filter - Only show items after certain date lookup in 2nd List

(0) ShareShare
ReportReport
Posted on by 113

Hello,

 

I have a gallery filtered to show the following items:

 

AddColumns(GroupBy((Filter(SPListDB,
    User().Email, "Supervisors",
    "Ready for Review" in Status.Value)),
   "Meeting Date","Grouped"),"Sum",CountRows(Grouped))

 

I now need to filter only items after a certain date.  The date is dependent on a separate list called "SettingsList", and the field "StartDate".

 

For example, If "Country" in SPListDB = "Country" in SettingsList we should filter gallery above to only show items with a "Date" (from SPListDB) on or after the "StartDate" specified in "SettingsList".

 

 

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

    Hi @LYNCHJL ,

    Please see code and comments below - I have given you the syntax, but you need to fix a few things.

    AddColumns(
     GroupBy(
     (
     Filter(
     SPListDB,
     User().Email, //this is not a valid filter
     "Supervisors", //this is not a valid filter
     "Ready for Review" in Status.Value &&
     Date >= //should not have a field called Date
     Lookup(
     SettingsList,
     Country=[@SettingsList].Country //consider renaming this - Ambiguity
     ).StartDate
     )
     ),
     "Meeting Date",
     "Grouped"
     ),
     "Sum",
     CountRows(Grouped)
    )

     

    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.

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @LYNCHJL ,

    Based on the Filter formula that you mentioned, I think there is something wrong with it. The User().Email, "Supervisors" could not be used as filter condition in your Filter function.

     

    I assume that the Supervisors column is a Person type column in your SPListDB, and you want to filter this column based on current sign in user, then you need to modify your formula as below:

    AddColumns(
     GroupBy(
     Filter(
     SPListDB,
     Supervisors.Email = User().Email, // Modify formula here
     "Ready for Review" in Status.Value
     ),
     "Meeting Date",
     "Grouped"
     ),
     "Sum",CountRows(Grouped)
    )

     

    For your current question, do you want to filter Gallery Items based on the "StartDate" column value from your "SettingsList"?

    1) If the "Country" in SPListDB could only match single one record in your "SettingsList", please try the following formula:

    AddColumns(
     GroupBy(
     Filter(
     RenameColumns(SPListDB, "Country", "Country1"),
     Supervisors.Email = User().Email, // Modify formula here
     "Ready for Review" in Status.Value,
     If(
     !IsBlank(LookUp(SettingsList, Country = Country1, StartDate)),
     DateValue(Text('Meeting Date', DateTimeFormat.ShortDate)) >= DateValue(Text(LookUp(SettingsList, Country = Country1, StartDate), DateTimeFormat.ShortDate)),
     true
     )
     ),
     "Meeting Date",
     "Grouped"
     ),
     "Sum",CountRows(Grouped)
    )

    2) If the "Country" in SPListDB could only match multiple records in your "SettingsList", and you want to show items with "Date" (from SPListDB) on or after that the latest StartDate value in your "SettingsList", please try the following formula:

    AddColumns(
     GroupBy(
     Filter(
     RenameColumns(SPListDB, "Country", "Country1"),
     Supervisors.Email = User().Email, // Modify formula here
     "Ready for Review" in Status.Value,
     If(
     !IsBlank(
     First(Sort(
     Filter(SettingsList, Country = Country1),
     StartDate,
     SortOrder.Descending
     )).StartDate
     ),
     DateValue(Text('Meeting Date', DateTimeFormat.ShortDate)) >= DateValue(Text(First(Sort(
     Filter(SettingsList, Country = Country1),
     StartDate,
     SortOrder.Descending
     )).StartDate, DateTimeFormat.ShortDate)),
     true
     )
     ),
     "Meeting Date",
     "Grouped"
     ),
     "Sum",CountRows(Grouped)
    )

     

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

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

    Thank you @v-xida-msft for the extrapolation of my thoughts - I was waiting for some confirmation from @LYNCHJL before guessing the filter code that should apply and also the nature of the related list fields.

    @LYNCHJL please tag whoever you want to continue this thread with,

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

    Hi @LYNCHJL ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    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.

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 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard