Showing results for 
Search instead for 
Did you mean: 
Helper V
Helper V

Inventory values based on period

Hello guys, me again... Man LOL


Well, I'm having troubles with values to make my inventory:


For example, I bought this items these days:




Another day, I send them, like these:




At PowerApp, I have two forms that I submit the purchases and sales, but in the second, I do not find a way to get the value as a exemplify below, just because a have to find, on the sell from the day 12, the last value in stock, the R$ 30,00; after this, I bought again, at this time, much more cheaper, R$ 5,00 each, wich let my value in stock better, just R$ 28,15, and now, when I made a new sell at 25/01, It cost me only this R$ 28,15.



Please, if anyone has an ideia about some function to use at Power App it will be very very appreciated.


Thank you so much.




Community Support
Community Support

Hi @rgparisoto,


Firstly, I notice that you said that you have 2 forms in PowerApps, but from your screenshot I only see one table. So are both forms have the same table as data source?


Also, I didn't totally get what you want to achieve in PowerApps. Would you please explain more?







Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Mona!


Yes, I have two tables, one that I use when I buy, and another when I sell.


When I buy, I have the values, but, when I sell, I don't know the correct value, because I can have two different values and I have to use an average based on the quantity wich is disponible in the inventory/stock.


For example:

- Imagine that I have two invoices, one at 10/01/2018 with 130 items, with the value of R$ 30,00 each (total of R$ 3.900,00), than my inventory has the same values;

- If I sell 5 items, I'll use as a cost the value of R$ 30,00 (R$ 150,00), and at my inventory/stock I left 125 items (R$ 3.750,00);

- Day 24/01/2018 I buy more 10 items, with the value of R$ 5,00 each (R$ 50,00), that I sum with the 125, resulting in 135 items, with a total value of R$ 3.800,00. Now I have the cost of (R$ 3.800,00 / 135) R$ 28,15 each item;

- If I sell another time, now the cost price is not R$ 30,00, is R$ 28,15 (because of the average of the total inventory/stock).


Take a look that I have hundreds of items, and each one has this history of values at the inventory/stock, and I have to get the correct value to calculate the profit between this price, and the another one I'll use selling.


If I can't explain efficiently to you please tell me that I try again.


Thank you so much for your help.





Hi guys!


I am creating a VM in Azure to see if I can solve my problem through a job or trigger. If I can not, I will not be able to make the app available to my client.


Any news I told you!





Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,448)