Forum Discussion
rajasekar_o
2 years agoHelper V
Inventory closing
hi team ,
i need help for calculate inventory opening and closing Quntity .
| Date | ITEMID | PLUSORMINUS | QTY |
| 31-03-2017 | RM ITEM A | p | 125000 |
| 01-04-2022 | RM ITEM A | p | 1000 |
| 02-04-2022 | RM ITEM A | p | 333 |
| 02-08-2022 | RM ITEM A | p | 200 |
| 02-02-2023 | RM ITEM A | m | 200 |
| 11-03-2023 | RM ITEM A | p | 100 |
| 31-03-2023 | RM ITEM A | p | 1100 |
| 04-04-2023 | RM ITEM A | p | 167 |
| 10-04-2023 | RM ITEM A | m | 81 |
| 13-04-2023 | RM ITEM A | m | 40 |
| 04-05-2023 | RM ITEM A | p | 50 |
| 05-05-2023 | RM ITEM A | m | 1 |
| 20-05-2023 | RM ITEM A | p | 55 |
| 30-05-2023 | RM ITEM A | p | 10 |
| 04-07-2023 | RM ITEM A | m | 10 |
| 05-09-2023 | RM ITEM A | p | 210 |
| 06-09-2023 | RM ITEM A | m | 515 |
| 09-09-2023 | RM ITEM A | m | 20 |
| 15-09-2023 | RM ITEM A | p | 160 |
| 16-09-2023 | RM ITEM A | p | 135 |
| 19-09-2023 | RM ITEM A | p | 28 |
| 20-09-2023 | RM ITEM A | p | 10 |
| 02-10-2023 | RM ITEM A | p | 33 |
I try following measure
Opening = CALCULATE(CALCULATE(SUM(STOCKVALUE[Qty]),FILTER(STOCKVALUE,STOCKVALUE[PLUSORMINUS]= "P")) ,WINDOW(0,ABS,-1,REL, ALL(STOCKVALUE[ITEMID], STOCKVALUE[DOCDATE]), ORDERBY([Date]))) - CALCULATE(SUM(STOCKVALUE[Qty]), WINDOW(0,ABS,-1,REL, ALL(STOCKVALUE[ITEMID], STOCKVALUE[DOCDATE]), ORDERBY([Date])), FILTER(STOCKVALUE,STOCKVALUE[PLUSORMINUS]= "M"))
CLosing = CALCULATE(CALCULATE(SUM(STOCKVALUE[Qty]),FILTER(STOCKVALUE,STOCKVALUE[PLUSORMINUS]= "P")) ,WINDOW(0,ABS,0,REL, ALL(STOCKVALUE[ITEMID], STOCKVALUE[DOCDATE]), ORDERBY([Date]))) - CALCULATE(SUM(STOCKVALUE[Qty]), WINDOW(0,ABS,0,REL, ALL(STOCKVALUE[ITEMID], STOCKVALUE[DOCDATE]), ORDERBY([Date])), FILTER(STOCKVALUE,STOCKVALUE[PLUSORMINUS]= "M"))
Opening and closing are not coming correctly.how to solve this
4 Replies
- Ashish_MathurSuper User
Hi,
I have solved a similar problem in the attached file.
Hope this helps.
- rajasekar_oHelper V
Ashish_Mathur
its not working any other solution for this problem- Ashish_MathurSuper User
How can i help you with just that one sentence. What is not working. Have you applied my technique/measures? Where are you stuck? Be specific.