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 Gallery with Su...
Power Apps
Unanswered

Filter Gallery with Sum(Filter

(0) ShareShare
ReportReport
Posted on by 44

I have been trying to understand why the code acts this way for a while now but cant understand.

 

Filter(
LagerFysiskaPlatsers;
StartsWith(Lagerplats; Text(varChosenLager));
StorlekLagerPlatsAm>Sum(Filter('LagerLoggedItems';LagerPlats = LagerFysiskaPlatsers[@Lagerplats]);SizeOfPallAm))

 

I am trying to compare the size of StorlekLagerPlatsAm to the Sum size of all SizeOfPallAm with the same Lagerplats in both tables. What is strange is that if i encase either the Sum part or StorlekLagerPlatsAm within Value() then the code works perfectly fine, but with a delegation warning since it goes thru the whole database to find the result. It also works if I encase the whole code within an If() and set the result as StorlekLagerPlatsAm, but again with a delegation warning.

 

This wouldnt be an issue if it was a smaller database i was working with, I would have just accepted the delegation warning. But it performs terribly slow when it activly converts to a Value since it then has to first read the the database and then set the result.

 

Any ideas on why it doesnt work with the code unless i convert it within a Value() or If()? In the Dataverse database both StorlekLagerPlatsAm and SizeOfPallAm  are numerical columns.

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,275 Most Valuable Professional on at

    Hi @DennisJarnstal ,

    If I am interpreting this correctly, the below may work for you

    With(
     {
     _Size:
     Sum(
     Filter(
     'LagerLoggedItems';
     LagerPlats in LagerFysiskaPlatsers.Lagerplats
     );
     SizeOfPallAm
     )
     };
     Filter(
     LagerFysiskaPlatsers;
     StartsWith(
     Lagerplats; 
     Text(varChosenLager)
     );
     StorlekLagerPlatsAm > _Size 
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • DennisJarnstal Profile Picture
    44 on at

    Hi Warren,

     

    I have tried inputting the code you stated and unfortunately it yields no results, no errors either. Im not sure if it is because the database is too large or something else that is causing this. If i remove from your code the section "StorlekLagerPlatsAm > _Size" then the code fetches all from database that startswith varChosenLager. So it is the size comparison that still creates a problem here aswell.

     

    Best regards

    Dennis

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard