Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 3PXKyCtLZVmyT5BYWYhkF0
Power Apps - Building Power Apps
Answered

Calculate the sum of each row based on the column in Power Apps.

Like (0) ShareShare
ReportReport
Posted on 25 May 2023 07:20:57 by 85

Hi there,

 

I am having some difficulties on creating the formula to calculate the sum of of each rows (Quantity) based on the columns (Part Number) and store the total sum in column named "Total Quantity".

Ex: Part Number = E-000001, Total Quantity is 27.

 

Can anyone help me on doing this, because I didn't found any tutorial on this. Thanks in advance.

Stock In Latest.PNG

  • Az8PnG Profile Picture
    85 on 30 May 2023 at 07:38:43
    Re: Calculate the sum of each row based on the column in Power Apps.

    Hello@Samuel-Zhou do u received my message?

  • Samuel-Zhou Profile Picture
    393 on 30 May 2023 at 01:11:27
    Re: Calculate the sum of each row based on the column in Power Apps.

    @Az8PnG Hi,we can use private message to discuss

  • Az8PnG Profile Picture
    85 on 30 May 2023 at 00:09:40
    Re: Calculate the sum of each row based on the column in Power Apps.

    Hi @Samuel-Zhou just try the code above. I just can't fix the problem yet. Do you mind if we discuss about this maybe in teams or skype?

  • Samuel-Zhou Profile Picture
    393 on 26 May 2023 at 04:15:08
    Re: Calculate the sum of each row based on the column in Power Apps.

    @Az8PnG Try this,

     

     

    AddColumns(
     GroupBy(
     AddColumns(
     StockInLatests,
     "Part Group",
     'Part Nubmer',
     "Quan",
     ThisRecord.Quantity
     ),
     "Part Group",
     "Quan"
     ),
     "QuanSum",
     Sum(
     ThisRecord.Quan,
     Quantity
     )
    )

     

  • Az8PnG Profile Picture
    85 on 26 May 2023 at 03:19:35
    Re: Calculate the sum of each row based on the column in Power Apps.

    Thank you Mr @Samuel-Zhou .

     

    My code is:

    GroupBy(SortByColumns('StockInLatests',"cre39_partnumber",SortOrder.Ascending),"cre39_partnumber","cre39_totalquantity",Sum(ThisItem.Quantity))

     

    I am having some error in this code which are: GroupByError.PNG

    and

    Error 2.PNG

     

    May I know why is this errors occurs?

     

    I will show you my column name as well:

    1. For Part Number PartName.PNG

    2. For Quantity

    Quantity.PNG

    3. For Total Quantity

    TotalQuantity1.PNG

  • Az8PnG Profile Picture
    85 on 26 May 2023 at 03:19:30
    Re: Calculate the sum of each row based on the column in Power Apps.

    Thank you Mr @Samuel-Zhou .

     

    My code is:

    GroupBy(SortByColumns('StockInLatests',"cre39_partnumber",SortOrder.Ascending),"cre39_partnumber","cre39_totalquantity",Sum(ThisItem.Quantity))

     

    I am having some error in this code which are: GroupByError.PNG

    and

    Error 2.PNG

     

    May I know why is this errors occurs?

     

    I will show you my column name as well:

    1. For Part Number PartName.PNG

    2. For Quantity

    Quantity.PNG

    3. For Total Quantity

    TotalQuantity1.PNG

  • Samuel-Zhou Profile Picture
    393 on 26 May 2023 at 01:23:06
    Re: Calculate the sum of each row based on the column in Power Apps.

    @Az8PnG Hi,you can try this code,

     

    GroupBy( SortByColumns( 'Your SharePoint List Name', "Part Number", Ascending ), "Part Number", "Part Number Sum", Sum(Quality) )
  • Az8PnG Profile Picture
    85 on 25 May 2023 at 12:47:58
    Re: Calculate the sum of each row based on the column in Power Apps.

    Hello Mr @Samuel-Zhou , thanks for your help.

    How about if I wanted to find the sum for every part number?How was the formula is going to look like?

  • Verified answer
    Samuel-Zhou Profile Picture
    393 on 25 May 2023 at 07:48:12
    Re: Calculate the sum of each row based on the column in Power Apps.

    @Az8PnG Hi,You can try this Code,

     

    Sum(Filter('list_name', Part Number = "E-000001"), Quality)

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 89 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 60

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 42 Super User 2025 Season 1

Overall leaderboard