Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Powerapps and Lists and looking up SUM of similar items

(0) ShareShare
ReportReport
Posted on by 5

Hi,
Im working as paramedic and am completely new to coding world. 
Currently I got into voluntary project and I have to manage my own expenses, deliveries, logistics for it. Trying to reduce manual labor with stocktaking, inventory counts, orders, ec.
I have this ridiculously easy and terribly complicated issue 🙂 

Listing nrNameRequired amountExisting amountTrauma bag
1Painkiller205Alpha
2Painkiller2010Bravo
3Syringe 10 ml105Alpha
4Syringe 10 ml105Bravo

 
List is approximately 300 rows, unique items by "Name" column are about 150.
That "Required amount" represents combined sum for all trauma bags, irrelevant if they all in one bag or shared.
In total, I should have 20 painkiller pills available. 
Desired outcome would be:

NameRequired amountExisting amount
Painkiller2015
Syringe 10 ml1010

In such way, I should order 5 painkillers  and 0 syringes.


I have managed to put it into Gallery, using Filter, and even email it, but it sends all rows, not as unique  and summed items. 
Ends up like this:
Dear pharmacy, 
Painkiller 15 pcs
Painkiller 10 pcs
Syringe 5 pcs
Syringe 5 pcs.


I am missing something very very obvious, I spent whole yesterday trying to figure it out, using Distinct, ForAll and such, but I end up with logic's error or formula errors, because I dont know how to.
Thankful for all waypoints that help me to get there 🙂

Thanks,
Assar Aip.



  • Assar_Aip Profile Picture
    Assar_Aip 5 on at
    Re: Powerapps and Lists and looking up SUM of similar items

    Thanks, 
    I replaced 

    "RequiredAmount",
     Sum(

    to 

    "RequiredAmount",
     Avg(

    And got exactly what I asked. 


  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 145,636 on at
    Re: Powerapps and Lists and looking up SUM of similar items

    Hi @Assar_Aip ,

    This should get you the outcome in your second table

    AddColumns(
     GroupBy(
     SPList,
     "Name",
     "Data"
     ),
     "RequiredAmount",
     Sum(
     Data,
     'Required amount'
     ),
     "ExistingAmount",
     Sum(
     Data,
     'Existing Amount'
     )
    )

     

    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.

    Visit my blog Practical Power Apps

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard