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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sum Nested Gallery For...
Power Apps
Answered

Sum Nested Gallery For Textbox Value

(1) ShareShare
ReportReport
Posted on by 92
Hello
 
Can I get help with this function 
I need to Sum Nested Gallery Textbox In powerapps
Gallery 3_1 Is main and Gallery2 is Child Gallery 
Label2_6.Text is the value I need to Sum
 
with This 
Sum(ForAll(Gallery3_1.AllItems As C,Sum(C.Gallery2.AllItems,Label2_6.Text)),Value)
 
there are no error but no display result in textbox
 

 
Categories:
I have the same question (0)
  • Suggested answer
    Ravi-Prajapati Profile Picture
    416 Super User 2025 Season 2 on at
    try this
    Sum(
        Gallery3_1.AllItems, 
        Sum(ThisItem.Gallery2.AllItems, Value(Label2_6.Text))
    )

     
  • CU12021118-0 Profile Picture
    8 on at
     
     
    again its working with no error but no display result
     
  • WarrenBelz Profile Picture
    153,073 Most Valuable Professional on at
    Technically what you have should work, but I have seen this before and it does not work (referring to a child gallery from the parent just does not seem to produce the desired results). You can try a couple of things using actual field name instead of the Label
    Sum(
       ForAll(
          Gallery3_1.AllItems,
          Sum(
             Gallery2.AllItems,
             FieldName
          )
       ),
       Value
    )
    or use AddColumns
    Sum(
       AddColumns(
          Gallery3_1.AllItems,
          Totals,
          Sum(
             Gallery2.AllItems,
             FieldName
          )
       ),
       Totals
    )
    but I have not been able to get either to display the expected value (although neither produce any errors)
     
    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    LinkedIn   
  • CU12021118-0 Profile Picture
    8 on at
     

    Hi WarrenBelz

    I try with both but always no errors and no data, when i try to collect data from the list its working

     

    Sum(Filter(collect, ….), value(DCost))

     

    but I don’t know if this way have to give always correct results  

    any thinking about it 

  • WarrenBelz Profile Picture
    153,073 Most Valuable Professional on at
    What is the Items (in Text please) of both the parent and child gallery ?
  • maheralkhalil Profile Picture
    92 on at
    Hi
    In Main Gallery
    For All(Sequence(42), Value+varCurrentDate-Day(varCurrentDate))
     
    In child
    Filter(TSDR, Date= ThisItem.value)
     
    TSDR Is Collected from SP List
     
    regards
  • Suggested answer
    WarrenBelz Profile Picture
    153,073 Most Valuable Professional on at
    In this case, you can do it directly on the data - use your number field where indicated
    Sum(
       Ungroup(
          ForAll(
             ForAll(
                Sequence(42),
                Value + varCurrentDate - Day(varCurrentDate)
             ) As _Dates,
             Filter(
                TSDR,
                Date = _Dates.Value
             )
          ),
          Value
       ),
       YourNumberField
    )
     
    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    LinkedIn   
  • maheralkhalil Profile Picture
    92 on at
     
    Thank you for your interest
    Again no error but no data, maybe i build the galleries  nested by no correct way so all formula i use do not working and no access to the field content.
     
    only one its working when i call the Data no based gallery
    Text(Sum(Filter(TSDR, ,,,,),Value(LCost),"0.00")
     
    this way is working but the problem need to call data with all filters for every field.
     
    Regards
  • WarrenBelz Profile Picture
    153,073 Most Valuable Professional on at
    I built a model with your exact code and tested it successfully getting the expected results, so I am not sure what is going on. How many records are in your table TDSR and what is your data source type ?
  • maheralkhalil Profile Picture
    92 on at
    TSDR is Collect 
     
    ClearCollect(TSDR, Filter('Time Sheet DR' , Locations = Office365Users.UserProfile(User().Email).OfficeLocation ))
    the records in the data too much but in the collection under 1000 
    and also the gallery showing all data i need but to sum that is given problem

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard