cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate I
Advocate I

How to sum numeric fields inside a browsegallery

 

I need to know how to add the price that is inside the browsegallery as seen in the photo and insert the result of the sum into a label

 

Sin título.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @jdelacrettaz,

 

You could take use of the Sum function here.

For example, the formula of the BrowseGallery Items property  is the following:

SortByColumns(Filter('Testing list', StartsWith(SText, TextSearchBox1.Text)), "SText", If(SortDescending1, Descending, Ascending))

 

Then under the Count total Label Text property, the sum formula for the Number field should be:

Sum(Filter('Testing list', StartsWith(SText, TextSearchBox1.Text)),

        Number

        )

 

Adding the code suggested by @Meneghino:

Sum(BrowseGallery1.AllItems,

         Precio)

Which should be better.

96.PNG

Adding the function reference:

Average, mAX, mIN, stdevP, Sum, and Varp functions in PowerApps

If you need any further assistance on this, please post back.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Community Support
Community Support

Hi @jdelacrettaz,

 

You could take use of the Sum function here.

For example, the formula of the BrowseGallery Items property  is the following:

SortByColumns(Filter('Testing list', StartsWith(SText, TextSearchBox1.Text)), "SText", If(SortDescending1, Descending, Ascending))

 

Then under the Count total Label Text property, the sum formula for the Number field should be:

Sum(Filter('Testing list', StartsWith(SText, TextSearchBox1.Text)),

        Number

        )

 

Adding the code suggested by @Meneghino:

Sum(BrowseGallery1.AllItems,

         Precio)

Which should be better.

96.PNG

Adding the function reference:

Average, mAX, mIN, stdevP, Sum, and Varp functions in PowerApps

If you need any further assistance on this, please post back.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Community Champion
Community Champion

Hi @jdelacrettaz

As an alternative you can also use Gallery1.AllItems, so something like Sum(Gallery1.AllItems.Precio)

The formula that worked for me was:

Sum(BrowseGallery3.AllItems;Body2_2)

thanks you so much for help me!!

 

Hi there, 

@v-micsh-msft , 

The solution works fine, but I have an issue when I add a new element to the gallery. (I have a Form that creates a new task and adds it to a gallery - source sharepoint-)

The new task shows in the gallery and in the source, but the label where I have the formula     Sum(ProjectTasksGal.AllItems,Total_Task_Price)

Doesn´t add the new task to the total... don´t know why!!!

 

Any hint is welcome!

Thanks in advace!

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (26,811)