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 / How to sum a gallery c...
Power Apps
Unanswered

How to sum a gallery column with only non blank values

(0) ShareShare
ReportReport
Posted on by 130

I have a gallery in which one column is displayed using text label, when I apply a filter then values change, I want to calculate sum of all values(non blank) from text label after filter.

I tried using :

1.Sum(galOrders.AllItems,
Label37_2.Text)

2.Sum(
Filter(
galOrders.AllItems,
!IsBlank(Label37_2.Text)
),
Value(Label37_2.Text)
)

 

ukg.PNG

 

In the screenshot above, after applying ukg class filter, the total sum should be around 250.

But its returning wrong sum.

 

Regards,

R

Categories:
  • turnerj3 Profile Picture
    2,039 on at

    @r_voyager ,

    Are you trying to sum the 'total kits' column for all items in the gallery?

  • r_voyager Profile Picture
    130 on at

    not for all items but only those where values are not zero. Formula has the all items because I don't know how to sum only for some(non zero values) items.

  • turnerj3 Profile Picture
    2,039 on at

    Try this:

    Sum(Filter(galOrders.AllItems,Value(Label37_2.Text)>0),Label37_2.Text)
  • r_voyager Profile Picture
    130 on at

    Hi @turnerj3 

     

    I tried your code but still no luck , getting wrong sum again.

  • PowerNuggets Profile Picture
    360 on at

    Hi @r_voyager 

     

    Check the post below it may help u

    https://powerusers.microsoft.com/t5/Building-Power-Apps/formula-do-not-sum-gallery-items-right/td-p/1276220

     


    _____________________________________________________________________________________
    Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.

     

    KR,

  • r_voyager Profile Picture
    130 on at

    I checked and tried the formulas but it didn't work.

     

    The things is in the text label I extract string from other column. I mean this text label only pick direct values from sharepoint column when one class filter is not applied, but if that filter is applied then it exratct a string from other column i.e total kits and I have formatted it as value.

    Don't know why any of the formulas are not working.

  • turnerj3 Profile Picture
    2,039 on at

    Does 790 make sense for the whole list or the whole gallery before the filter?

  • r_voyager Profile Picture
    130 on at

    no it doesn't make sense, after applying the filter if I calculate all values under total kits label in gallery then it should be around 250. 

  • WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    @r_voyager , 

    Try

    Sum(
     galOrders.AllItems,
     Label37_2
    )

    Also have the formula there to be zero if no total.

     

  • turnerj3 Profile Picture
    2,039 on at

    @r_voyager ,

    Not sure exactly how your gallery items and filters are setup, but something seems to be causing a problem. Technically 0s shouldn’t matter anyway. What happens if you try to sum based on your filter?

     

     Sum(Filter(galOrders.AllItems, Class.value=“UKG”),Label37_2.Text)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 383 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 356

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard