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 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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,385)