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 add Total Row i...
Power Apps
Answered

How to add Total Row in gallery data power app

(0) ShareShare
ReportReport
Posted on by 177

Hi,

I have gallery which showing prices of fruits based on month.

 

I want to add Total Row at the end of the Data which shows sum of fruits based on months as shown below.

 

This is already achieve

 

FruitsJanFebMar
A1015
B542
C523

 

I need to insert Total Row as below

FruitsJanFebMar
A1015
B542
C523
TOTAL20710

 

Also, number of fruits are dynamic, it may be less or more than 3, it can be any number.

Please suggest!!

 

Thanks

Amit 

http://fascinatingsql.blogspot.com/

https://youtu.be/Hoa7rkyUlzs

Categories:
I have the same question (0)
  • Verified answer
    CU-18081211-6 Profile Picture
    9,270 Moderator on at

    Hi @amsrivas 

     

    The easiest way to solve it is to put labels under gallery for each column and set their text property to:

    Sum(Gallery.AllItems, NameOfTheColumn) (to be sure that it is a number, put Value(NameOfTheColumn)).

     

    Set the Y property to all this labels to Gallery.Y + Gallery.Height.

     

    I think that you also should set the Height of the Gallery to Gallery.TemplateHeight * CountRows(datasource) and set Template Padding to 0.

     

    Hope it helps !

  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    Hi @amsrivas  

    Another solution is to collect one more record to your datasource (but you'll  have to do it outside the gallery), similar to this:

     

    Collect(fruits,{Fruits:"Total",Jan:Sum(fruits,Jan),Feb:Sum(fruits,Feb),Mar:Sum(fruits,Mar)})

     

    Of course in this case the Height of the Gallery need to be set to Gallery.TemplateHeight * (CountRows(fruits)+1) and set Template Padding to 0.

    And if your first line is also part of the fruits collection it will +2. 😊

     

    This proposal is least resource consuming. 

     

    Hope, again, that it helps !

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 547

#2
WarrenBelz Profile Picture

WarrenBelz 444 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard