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

Gallery GroupBy and Sum

Like (0) ShareShare
ReportReport
Posted on 30 Jun 2020 11:32:28 by 704

I have a gallery connected to a collection.  I'm trying to groupby facilitator and sum their duration to show number of hours delivered.

 

I have grouped the facilitators ok using this formula on the gallery:

 

SortByColumns(GroupBy(AddColumns(FT,"Facilitator",Facilitator1.Value),"Facilitator","FAC1"),"Facilitator",Ascending)

I'm unsure how to include the Sum on the Duration field.

 

Example of data:

 

Joe Bloggs       1.5

James Test       1

Joe Bloggs       3

 

What i want the gallery to show is:

 

James Test     1

Joe Bloggs     4.5

 

Is this possible and can someone advise please?

 

thanks

Alistair 

  • Verified answer
    mdevaney Profile Picture
    29,987 Moderator on 30 Jun 2020 at 12:04:41
    Re: Gallery GroupBy and Sum

    @neill_long 
    Put this code in the Items property of your Gallery.  It will add a new column for the sum called Sum Of Value

    SortByColumns(
     AddColumns(
     GroupBy(
     AddColumns(FT,"Facilitator",Facilitator1.Value),
     "Facilitator","FAC1"
     ),
     "Sum Of Value", Sum(FAC1, Duration)
     ),
     "Facilitator",
     Ascending
    )


    Then create a new label in your gallery with this code in the Text property

    ThisItem.'Sum Of Value'

     


    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Verified answer
    eka24 Profile Picture
    20,921 on 30 Jun 2020 at 12:02:38
    Re: Gallery GroupBy and Sum

    On the Gallery Items:

    AddColumns(GroupBy(
               AddColumns(FT,"Facilitator",Facilitator1.Value),
               "Facilitator","GroupedFaci"),
          "SumValue",Sum(GroupedFaci,DurationColumn))

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

    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.

  • JayMagness Profile Picture
    1,663 on 30 Jun 2020 at 11:40:43
    Re: Gallery GroupBy and Sum

    HI,

     

    Put a text box or label outside the gallery and [Sum( "Gallery_name", "Field")]

     

    I will send more information directly

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete