cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Becca51178
Helper II
Helper II

How to filter a gallery based of the count of another list

SPList1 = Event List

SPList2 = Signup form for event list

 

Here is the process. SPList1 has all the events available for sign up and it has a column called Volunteers Needed which is the number of people needed for each event

 

SPList 2 is the signup sheet. 

 

I need to be able to filter out an event in a gallery when the count of signees for an event on SPList2 equals the number of volunteers needed on SPList1

 

The filter code below doesn't work. Do I need to create a second collection instead?

Any help would be awesome

 

Filter(SPList1,
         EventType="Project",
        EventSupportSearchDate<=Today(),
       SupportStaffNeeded= true,
       EventSupportSearchDate<=Today(),
      LastDaytoRegister>=Today(),
     Not(EventName in UserSignUpList.EventName),
    EventLeader.DisplayName<>Var_OfficeName,
   EventName && VolunteersNeeded=(CountRows(Filter(SPList2, EventName))))

1 ACCEPTED SOLUTION

Accepted Solutions
EricLott
Resident Rockstar
Resident Rockstar

You can use this to build on to your event list. This would replace the general SPList1 reference in your filter.

 

AddColumns(SPList1,"EventFull",CountRows(Filter(SPLst2,EventID=[@EventID]))>=NumberOfSupportStaffNeeded)

 

 Here is the docs for AddColumns()

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-shaping

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

View solution in original post

2 REPLIES 2
EricLott
Resident Rockstar
Resident Rockstar

You can use this to build on to your event list. This would replace the general SPList1 reference in your filter.

 

AddColumns(SPList1,"EventFull",CountRows(Filter(SPLst2,EventID=[@EventID]))>=NumberOfSupportStaffNeeded)

 

 Here is the docs for AddColumns()

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-shaping

---
If this answered your question, please click "Accept Solution". If this helped, please Thumbs Up.

Thank you! This worked great!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,219)