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 / Filter inside filter f...
Power Apps
Answered

Filter inside filter for each record

(0) ShareShare
ReportReport
Posted on by 8

Hi!

 

I´m updating a funcion of Building Access app

 

I have an error with geting a filter of each record of parent filter:

 

ClearCollect(colReservedSpaces,
Filter(
BAR_Requests,
RequestDate >= datepkStartDate.SelectedDate && RequestDate <= datepkEndDate.SelectedDate,
Active = 1,
TimeSlot="Full-day" ||TimeSlot in cmbSelectSlot.SelectedItems,
SpaceName = cmbSelectSpace.Selected.Title,
( Count( Filter( BAR_Requests, Active = 1, RequestDate = ThisRecord.RequestDate).ID ) >= varTotalSeats)
))

The last sentence Filter, the ThisRecord i´m not sure if it´s getting the firt BAR_request statement or the second BAR_Request

 

That I need is to make a count over each record on the first BAR_request filter

 

Thanks a lot

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @lucasm107 

    Please consider changing your Formula to the following:

    ClearCollect(colReservedSpaces,
     With({_reqs: Filter(BAR_Requests, Active=1 && RequestDate >= datepkStartDate.SelectedDate && RequestDate <= datepkEndDate.SelectedDate)},
     Filter(
     Filter(_reqs,
     (TimeSlot="Full-day" || TimeSlot in cmbSelectSlot.SelectedItems) &&
     SpaceName = cmbSelectSpace.Selected.Title
     ) As _item,
     
     CountRows(Filter(_reqs, RequestDate = _item.RequestDate)) >= varTotalSeats
     )
     )
    )

    This should give you what you are looking for.

     

    I hope this is helpful for you.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard