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 list based on s...
Power Apps
Answered

Filter list based on sum of lookup values

(0) ShareShare
ReportReport
Posted on by 61

Hello everyone, following scenario:

2 SharePoint lists: Assets and Bookings. Every item in Bookings has a lookup to the booked asset and an amount of how many have been booked, while the Assets list has a total amount called stock.


Currently I have a Combobox with all available assets, and when I select one, I have a label that tells me how many are still available during a previously selected timeframe between StartDate and EndDate.

 

The code looks like this:

LookUp(
 Assets,
 ID = cmb_Asset.Selected.ID
).Stock - Sum(
 Filter(
 AssetBooking,
 Asset.Id = cmb_Asset.Selected.ID && StartDate <= eventSelected.EndDate && EndDate >= eventSelected.StartDate
 ),
 Amount
)

 

This work fine for me. But now I want to change the combobox in a way, that it only shows the assets, that have at least 1 available item during the event.

I played around a lot with filters and lookups, but I can't seem to get it right. Can anyone help me with this?

Categories:
  • Dioz Profile Picture
    61 on at

    Thank you @Rajkumar_404 ! I tried pretty much exactly that before, but it doesn't seem to work. I think the problem is with the "Asset.Id = ID" part. ID in that context would refer to the ID of the booking itself, while Asset.Id refers to the ID of the item in the asset list. I somehow have to check the Asset.Id against the ID of the Asset in the "first" filter.

  • Dioz Profile Picture
    61 on at

    Anyone an idea what else I could try? Could a distinct function help me in this case?

  • Verified answer
    Dioz Profile Picture
    61 on at

    Just to properly close the case: Assets[@ID] was what I was looking for, to iterate through all items in the Assets list, didn't know that this is possible.

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard