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

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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard