cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dataanalytics
New Member

(Sum(ProjectsGallery_2.AllItems,) only working on scroll down

HI All, 

 

We are hoping someone has some tips for us. We have developed a Projects Gallery that references our SQL database. 

 

We have label that  references the projects gallery and sums the items based on filters. 

 

It works except it only sums what is immediately present in the gallery box onscreen. We need to scroll to the bottom of the galley for the sum to be correct. It is filtering Correctly.

 

The code we have used in the label. 

 

Text(Round(Sum(ProjectsGallery_2.AllItems,'FY Budget'),0),"[$-en-US]$0#,###")

 

Does anyone know what code to add so the sum occurs without the requirement for scroll down in the gallery to load all the data?

 

Thanks

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @dataanalytics ,

I am suspecting that your query does the normal thing and bring back 100 items at a time. If your filter brings back less than 2,000 items, you can sum the same filter as the gallery, but beyond that Sum() is not delegable directly on a dataset.

 

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.

shoog
Dual Super User
Dual Super User

The AllItems property of gallery controls only holds the visible content at first, so it's not a good practise to reuse it to sum it's contents.

Your best option is to replace ProjectsGallery_2.AllItems with the code from the Items property of ProjectsGallery_2, which probably references a datasource or collection.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,192)