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 / 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)
  • Verified answer
    WarrenBelz Profile Picture
    154,496 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

     
  • StephenGW Profile Picture
    583 on at
    Thank you again Warren for a great answer and explanation!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 531 Most Valuable Professional

#2
Haque Profile Picture

Haque 261

#3
Kalathiya Profile Picture

Kalathiya 221 Super User 2026 Season 1

Last 30 days Overall leaderboard