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 / Sum columns in Datatable
Power Apps
Answered

Sum columns in Datatable

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi everyone.  I have a SharePoint list that I am using in a DataTable.  These are orders placed to our website from our customers.  Each item ordered has its own line, but the order# (DRMNum in this case) may be duplicated in the list if multiple items were ordered.  I would like to be able to SUM the GrandTotal column based on the DRMnum if thats possible.  So for each order show only 1 row with the DRMNum and the sum of the GrandTotal of all items ordered.

 

Thanks for the help!

Chris

1.png
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,926 Most Valuable Professional on at

    Hi @Anonymous ,

    You can do this using GroupBy() on the data source if displayed in a gallery, but not in a data table.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz thank you very much!  My Items portion of my Gallery is set to GroupBy(DepotPlacedOrders,"DRMNum","DATA") and it is grouping the DRMNum properly.  How do I SUM the GrandTotal field or add other info into the gallery from my list?

     

    Thanks again!

     

    Chris

  • Verified answer
    WarrenBelz Profile Picture
    154,926 Most Valuable Professional on at

    Hi @Anonymous ,

    Try

    AddColumns(
     GroupBy(
     DepotPlacedOrders,
     "DRMNum",
     "DATA"
     ),
     "GTotal",
     Sum(DATA,GrandTotal)
    )
    

     

    Please click Accept as solution 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 Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @WarrenBelz Perfect, thank you again sir!

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 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard