Skip to main content

Notifications

Community site session details

Community site session details

Session Id : MVzhG5HZg3mKuDDhURDNWT
Power Apps - Building Power Apps
Answered

Running Total in Filtered Gallery

Like (0) ShareShare
ReportReport
Posted on 28 Oct 2024 20:05:37 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:
  • StephenGW Profile Picture
    583 on 30 Oct 2024 at 17:48:15
    Running Total in Filtered Gallery
    Thank you again Warren for a great answer and explanation!
  • Verified answer
    WarrenBelz Profile Picture
    146,508 Most Valuable Professional on 29 Oct 2024 at 03:44:20
    Running Total in Filtered Gallery
    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

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,440 Most Valuable Professional

Leaderboard
Loading started