Forum Discussion
Stock quantity counting help
- 4 years ago
Hi, i found the solotion. In the item table for each row i created a new cumulative sum column. After that, i created a measure that gets me the max ID for each date. After that i know the row with the quantity i am looking for.
Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. Screenshots of your source data are not useful.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
Hello,
Thanks for the reply.
Expected Outcome:
At each documentheader fulfillmentdate, i would like to get the actual stock quantity, based on document movement.
Filtering: 2022.01.01 - 2022.12.31
2022.may 11. --> 40 --> Started at 0, but got a delivery +40
2022.jun.2 --> 40 --> Started at 40, followed by - 20 + 20, the outcome is 40.
2022.jun 9 --> 39 --> Started at 40, sold 1, outcome is 39
2022.jun 10 --> 38 --> Started at 39, sold 1, outcome is 38
2022.jun 17 --> 37 --> Started at 38, sold 1, outcome is 37
2022.jun 24 --> 36 --> Started at 37, sold 1, outcome is 36
2022.jun 25 --> 35 --> Started at 36, sold 1, outcome is 35
and so on...
Filtering: 2022.06.10 - 2022.06.24
2022.jun 10 --> 38 --> Before 06.10 the stock is 39, sold 1, outcome is 38
2022.jun 17 --> 37 --> Started at 38, sold 1, outcome is 37
2022.jun 24 --> 36 --> Started at 37, sold 1, outcome is 36
If i close up the matrix i should see Stock quantity 36 as this is the last value of the filtering.
Relationships: