cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Count and compare data in CDS, that meets a specific condition in PowerApps

I know that in PowerApps you can use the LookUp function to find the data in CDS that meets a specific condition. Is there a function, either in PowerApps or a setting in CDS, that can count all the data/forms that meet a specific condition? 

I have two CDS entities: one that stores information for upcoming events and one that stores the information for individuals who have registered for an event (all submitted as forms). I currently have a field in the upcoming events entity that stores the maximum number of attendees for that event. I would like to implement a method in PowerApps/CDS that can count the nubmer of individuals who have registered for a specific event, and compare it to the maximum number of attendees field, set for that specific event in the upcoming events entity. If the maximum number of attendees field for that event is equivalent to the number of people who have registered for that event, I will complete a specific action in PowerApps. 

 

Any ideas? Thank you very much 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Count and compare data in CDS, that meets a specific condition in PowerApps

Wrap countrows() around the filter() function for your collection and display the result in a label. For example
Countrows(Filter(Event,registered="attending"))

View solution in original post

1 REPLY 1
Super User
Super User

Re: Count and compare data in CDS, that meets a specific condition in PowerApps

Wrap countrows() around the filter() function for your collection and display the result in a label. For example
Countrows(Filter(Event,registered="attending"))

View solution in original post

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (5,889)