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
Anonymous
Not applicable

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
Anonymous
Not applicable

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 Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,124)