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 data from list
Power Apps
Answered

Filter data from list

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I have two lists: "Desk" and "DeskReservations" list.

 

In my "Desk" list I have the following:

ClearCollect( Desk, { Title: "Room 1",  Capacity: 2}, { Title: "Room 2",  Capacity: 2}, { Title: "Room 3",  Capacity: 4}, { Title: "Room 4",  Capacity: 2}, { Title: "Room 5",  Capacity: 3} )

 

In my "Desk Reservations" list I have the following:

ClearCollect( DeskReservations, { Title: "Room 1",  ReservedBy: some name, Datebooked: 23/10-2022}, { Title: "Room 1",  ReservedBy: some name, Datebooked: 23/10-2022}, { Title: "Room 2",  ReservedBy: some name, Datebooked: 23/10-2022}, { Title: "Room 2",  ReservedBy: some name, Datebooked: 24/10-2022}, { Title: "Room 3",  ReservedBy: some name, Datebooked: 23/10-2022}, { Title: "Room 4",  ReservedBy: some name, Datebooked: 23/10-2022}, { Title: "Room 1",  ReservedBy: some name, Datebooked: 24/10-2022} )

 

I want to filter my "Desk" list in a way so that I only get items that has still capacity in a particular date. For Example: lets say the date is 23/10-2022. Then by looking at my "DeskReservations" list. I can see that I have Room 1 booked 2 times in 23/10-2022. Since Room 1 only has the capacity of 2 then I know that I cannot book it that day and thus it should not be one of the items in my "Desk" list after filtering.  After filter the items available in my "Desk" list should be:

 

{"Room 2", "Room 3" "Room4, "Room 5"}

 

How can I achieve that? I have been struggling with what conditions I should have in my filter function to achieve it.. Any help appreciated! thanks!

 

 

Categories:
  • Verified answer
    BCLS776 Profile Picture
    8,994 Moderator on at

    It sounds like you will need a Filter() combined with a LookUp to do what I think you're after. Something like:

    Filter(DeskReservations As aReservation,
     aReservation.Datebooked = DatePicker1.SelectedDate, // Or a similar condition on date
     LookUp(Desk, aReservation.Title = Title, Capacity) > 2 // Or a similar condition to establish a limit
    )

    Hope that helps,

    Bryan

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 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard