web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Running Total in Filte...
Power Apps
Answered

Running Total in Filtered Gallery

(0) ShareShare
ReportReport
Posted on by 583
I have a gallery called Gallery2 that is filtered by some DatePickers and a Variable that outputs different text. I need to have a running total in that gallery but I cannot seem to make it work. The gallery is filtered like this. (Courtesy of the great Warren Belz!)
 
Filter(
   'SPList',
   (
      Value(DatePicker2_1.SelectedDate) < 1 ||
      DateStarted >= DatePicker2_1.SelectedDate
   ) &&
   (
      Value(DatePicker2.SelectedDate) < 1 ||
      DateEnded <= DatePicker2.SelectedDate
   ) &&
   (
      Len(varLine) = 0 ||
      Line = varLine
   )
)
 
I then need the running total inside Gallery2. Does anybody have an idea on how I can do this? I tried something like this.
Sum(Filter(Gallery2.Selected.ReoveredHours, SPList.ID>=ThisItem.ID),RecoveredHours)
 
Edit: I am also trying to avoid delegation warnings in this app as well.
 
I keep running into errors and cannot seem to figure this one out though. Any help would be appreciated.
Categories:
I have the same question (0)
  • StephenGW Profile Picture
    583 on at
    Thank you again Warren for a great answer and explanation!
  • Verified answer
    WarrenBelz Profile Picture
    153,508 Most Valuable Professional on at
    Hi StephenGW ,
    This should work on a label in a gallery but bear in mind the output of the top filter still needs to be under your Data Row Limit to receive the full total. Also it could be a lot of API calls and may be slow.
    With(
       {
          _Data:
          Filter(
             'SPList',
             (
                Value(DatePicker2_1.SelectedDate) < 1 ||
                DateStarted >= DatePicker2_1.SelectedDate
             ) &&
             (
                Value(DatePicker2.SelectedDate) < 1 ||
                DateEnded <= DatePicker2.SelectedDate
             ) &&
             (
                Len(varLine) = 0 ||
                Line = varLine
             )
          )
       },
       Sum(
          Filter(
             _Data,
             ID >= ThisItem.ID
          ),
          RecoveredHours
       )
    )

    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 427

#2
WarrenBelz Profile Picture

WarrenBelz 360 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 336 Super User 2025 Season 2

Last 30 days Overall leaderboard