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 / how do i sum all based...
Power Apps
Answered

how do i sum all based on the condition in gallery?

(0) ShareShare
ReportReport
Posted on by 219

Hi Folks, 

 

I have a gallery links to SP list and the list contains a Total and Cost Center columns. I have a hard time figuring out the correct formula to sum a specific cost center. Below is an example of what it looks like 

 

ntt56k4_1-1619802284017.png

 

Thanks

 

Categories:
I have the same question (0)
  • zmorek Profile Picture
    3,272 on at

    Sum(Filter(ListName, 'Cost Center' = "A"), Total)

  • eka24 Profile Picture
    20,923 on at

    Insert a Label and on the Text property:

    Sum(Filter(Table1,CostCenter= Gallery1.Selected.CostCenter),Total)

     

    Thus whichever cost center is selected in the Gallery, it would be summed.

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • ntt56k4 Profile Picture
    219 on at

    ok thanks but I don't want to sum everything on the sharepoint.  I Just want to sum what is on the gallery since the gallery filters based on the selected date drop down. 

  • ntt56k4 Profile Picture
    219 on at

    thanks but unfortunately I need to display the total from each cost center in the gallery because the gallery is filter from the date selected drop down. 

  • ntt56k4 Profile Picture
    219 on at

    I tried the formula below and is not working 

     

    Sum(Filter(Gallery, 'Cost Center '="A"),Total)

     

    What I am really looking is to display each cost center with the total amount on another Gallery, rather than creating separate label for each cost center to show the total for each cost center... 

  • ntt56k4 Profile Picture
    219 on at

    I also tried below and is not working either 

     

    Sum(Filter(SPList, Gallery.AllItems,'Cost Center '),Total)

  • Verified answer
    eka24 Profile Picture
    20,923 on at

    Have you tried the solution I gave:

    Sum(Filter(Table1,CostCenter= Gallery1.Selected.CostCenter),Total)

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • ntt56k4 Profile Picture
    219 on at

    yes the formula below works but it only shows the total cost center amount from the selected item in Gallery, but rather I would like to display the total for each cost center without having to select the item in the gallery. 

     

    Sum(Filter(SPList,CostCenter= Gallery1.Selected.CostCenter),Total)

  • eka24 Profile Picture
    20,923 on at

    Insert a Gallery and put this formula on the Items Property:

    AddColumns(
    GroupBy(Datasource,"CostCenterColumn","SumT"),
    "Totals", Sum(SumT,TotalColumn))

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • ntt56k4 Profile Picture
    219 on at

    thanks again but it won't recognize the cost center column nor the total column.. It shows a list of Cost Center datacards and Total datacards and not the column itself.. I really don't mind creating a separate label for each cost center to get the total for each cost center if it makes it easier. 

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

#2
Kalathiya Profile Picture

Kalathiya 340

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 333 Super User 2025 Season 2

Last 30 days Overall leaderboard