Forum Discussion
Create Historical Stock
- 2 years ago
Hi,
Share the download link of the PBI file. Ensure that in the Stock Table, there is a Date column.
Stock Table
Let's say today is 2024-01-02
Product Quantity
A 100
B 50
Shipment Table
Product Shipped Date Quantity
A 2024-01-01 10
A 2023-12-31 10
B 2023-12-30 10
Input Stock Table
Product Shipped Date Quantity
A 2024-01-01 30
B 2023-12-31 40
In this case, I want to make a line graph that shows entire stock and of course it should be filtered by product.
If I show expected value by table,
Product Date Stock Quantity
A 2024-01-02 100 Current Stock
B 2024-01-02 50 Current Stock
A 2024-01-01 100 After 10 Shipped, 30 input
B 2024-01-01 50 No transaction, no input
A 2023-12-31 80 After 10 Shipped
B 2024-12-31 50 After 40 Shipped
A 2023-12-30 90 No transaction, no input
B 2024-12-30 10 After 10 input
Based on this stock in the graph should be...
In case Daily Stock, it should show sum of each product stock.
In case Monthly Stock, it should show sum of each product stock at the last day of a month.
It is very complicated...
- Ashish_Mathur2 years agoSuper User
Hi,
I just cannot understand how you arrived at the number in the third table. Put all information in an MS Excel file and calculate the numbers shown the Balance column of the third table via Excel formulas. I will try to convert those Excel formulas to DAX formulas.
- Young_G_Han2 years agoHelper III
Let me explain.
The third table is from my idea.
Let's take the item A.
On day 2023-12-30, 90pcs in stock.
On day 2023-12-31, 10pcs were shipped. So remain stock is 80pcs.
On day 2024-01-01, from 80pcs. 10pcs were shipped and 30pcs input. So remain stock is 100pcs.
On day 2024-01-02. from 100pcs. there is no shipment or input. So still 100pcs are in stock.
This is what I want.
Problem is I have current stock, in this case 100pcs. at 2024-01-02.
I have to create a graph by reverse calculation...
Hope it is clear.
- Ashish_Mathur2 years agoSuper User
Hi,
I have solved a similar problem in the attached files where closing stock has to be calculated from opening stock, purchases and sales. Yours is the reverse case. Please try to adapt the solution to your specific case.
Hope this helps.