web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sum of the Gallery all...
Power Apps
Unanswered

Sum of the Gallery all items

(1) ShareShare
ReportReport
Posted on by 16
Hi Every one 
 
i have button and gallery if the user clicks the button the new item will added to  gallery with empty fields in gallery then user will enter the data in that textboxes in those textboxes i have the txt_hrs , txt_amtphr and txt_ttl .txt_ttl will the view only which is set the formula i.e  
If(
    IsBlank(txt_hrs.Text),
    ThisItem.Ttl,
    (Value(txt_hrs.Text) * Value(txt_amtphr))
)  
Now i need the total of the txt_ttl all gallery items i have given the Text label outside of the gallery and the formula is given like this 
Sum(Glry_Part.AllItems,txt_ttl.Text) but im not getting the total value.
Button onselect property is having the collections the same collection i have given to gallery items 
Please give solution for getting the total value 
 
Thank you 
Categories:
I have the same question (0)
  • Suggested answer
    jpespena Profile Picture
    335 on at
    Sum of the Gallery all items
    Hi,
     
    Try
    Sum(Glry_Part.AllItems,Value(txt_ttl.Text))

    If my post helped resolve your issue, please click Accept as Solution—this helps others find it more easily and marks the item as closed. If you found this or my previous reply helpful, a Like would also be appreciated!

  • SKrish Profile Picture
    16 on at
    Sum of the Gallery all items
    I have tried the this formula but unfortunately not getting the total value.
  • SKrish Profile Picture
    16 on at
    Sum of the Gallery all items
    Hi Can any one show me the solution for this @WarrenBelz
  • WarrenBelz Profile Picture
    152,843 Most Valuable Professional on at
    Sum of the Gallery all items
    Can you please post a screen shot of exactly what you are trying to do. Do you see the correct values in txt_ttl ? The code provided by @jpespena is what I would have responded with based on what you have posted. Also what is your data source type and what is the Items of the gallery ?
  • SKrish Profile Picture
    16 on at
    Sum of the Gallery all items
    Hi
     
    On Click of the button clicks it adds to new line item in gallery and user will the data in gallery the Gallery items will be collection of the button clicks added the image for reference. Im not getting the total sum of the total value Please reference images 
  • Suggested answer
    jpespena Profile Picture
    335 on at
    Sum of the Gallery all items
    Hi,
     
    Based on this screenshot I think the formula is correct since total cost column shows 250 and 1200, which when added is 1450 equal to what is showing on your screenshot in the formula bar:
     
    If it's correct in the formula, probably you need to check the properties of your Text Input control like color, font size, etc to see why it's not showing the value.
     

    If my post helped resolve your issue, please click Accept as Solution—this helps others find it more easily and marks the item as closed. If you found this or my previous reply helpful, a Like would also be appreciated!

  • WarrenBelz Profile Picture
    152,843 Most Valuable Professional on at
    Sum of the Gallery all items
    I cannot see any values in any of those text controls, so how are you going to total them ? Can you please just post the gallery showing the txt_ttl control and the values you are expecting to total. The question you posted was why this is not totalling in the label outside the gallery with the formula you have used.
  • SKrish Profile Picture
    16 on at
    Sum of the Gallery all items
    Hi â€‹â€‹â€‹â€‹â€‹â€‹â€‹
     
    Here the the image im not getting the total vale here i have multiple formulas for getting the Total from the gallery but im not getting the total value Can you Help me to get the value I have checked the fonts and color all those things but total value will be blank but its showing in the formula bar 
     

  • WarrenBelz Profile Picture
    152,843 Most Valuable Professional on at
    Sum of the Gallery all items
    Assuming that those values are displayed in txt_ttl which is a Classic Text Control, where the Default is
    If(
       IsBlank(txt_hrs.Text),
       ThisItem.Ttl,
       (Value(txt_hrs.Text) * Value(txt_amtphr))
    ) 
    then the formula
    Sum(
       Glry_Part.AllItems,
       Value(txt_ttl.Text)
    )
    should display the total as expected. I have tested it here and it produces the correct results (and is the original code supplied to you based on the information you have posted).
  • SKrish Profile Picture
    16 on at
    Sum of the Gallery all items
    im Sorry @WarrenBelz 
    Im not getting the total value in to the text box but when i hover the formula bar the its getting the total value 
     
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 836 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 231 Super User 2025 Season 2

Last 30 days Overall leaderboard