Hi all,
I am looking for some guidance on how to best approach a way to calculate figures held in a SharePoint list, and most likely saving them to a second list....
Scenario:
I am trying to build a Stock Control system that receives stock in, as well as tracks the movement and usage so that I have a live feed of what stock is actually on hand using powerapps as the front end.
At the moment I have built a list that collects the stock name, its batch code and I have the ability to assign it a bar code (there are a lot more fields, but not necessary for accomplishing this solution).
So I might have data that looks like this:
| BarCode | StockName | BatchCode | DateReceived | Amount |
| Z-0001-T | ITEM1 | EM1862 | 01/01/2020 | 1500 |
| Z-0001-A | ITEMC | 120506 | 04/01/2020 | 100 |
| Z-0001-T | ITEM1 | EM1862 | 10/02/2020 | 2000 |
| Z-0002-T | ITEM1 | EM1111 | 15/03/2020 | 1550 |
What I would like to do, is calculate the totals for all items with unique batch codes. So what I should end up with is:
| BatchCode | TotalAmount | |
| EM1862 | 3500 | |
| EM1111 | 1550 | |
| 120506 | 100 | |
So each time I receive stock with a matching batchcode and enter it into the first SP list, a flow then assess this and recalculates the total stock for that batch code. But I need to do this for every different batch code entered into the system.
Or maybe there is another way of achieving this through powerapps? In a nutshell, I need to be able to get a total for each stock item with the same batch code, so I can then track how much is on hand based on usage data being tracked on a different SP list.
Open to any suggestions.
Thanks