Forum Discussion
Stock simulation over time
- 4 years ago
Hi, robbinkees1
You can try the following methods.
Measure:
Stock over time = SUM ( 'Table'[Current_Stock] ) + CALCULATE ( SUM ( 'Table'[in/out] ), FILTER ( ALL ( 'Table' ), [Date] <= SELECTEDVALUE ( 'Table'[Date] ) ) )Column = [Current_Stock] + CALCULATE ( SUM ( 'Table'[in/out] ), FILTER ('Table' , [Date] <= EARLIER( 'Table'[Date] ) ) )Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi amitchandak
Thanks for your reply!
But unfortunately it keeps calculating with the current stock of 83 on every day, I want to simulate it further over the time based on the incoming and outgoing stock. it doesn't need to fall back to the current.
Tried both measures.
I want that it continues over time and simulating my stock levels.
So for example after 5/16/2022 it should calculate with 74 instead of 83.
The calculation on 5/23/2022 should be 74 - 6 instead of 83 - 6.
Hi, robbinkees1
You can try the following methods.
Measure:
Stock over time =
SUM ( 'Table'[Current_Stock] )
+ CALCULATE (
SUM ( 'Table'[in/out] ),
FILTER ( ALL ( 'Table' ), [Date] <= SELECTEDVALUE ( 'Table'[Date] ) )
)
Column =
[Current_Stock]
+ CALCULATE (
SUM ( 'Table'[in/out] ),
FILTER ('Table' , [Date] <= EARLIER( 'Table'[Date] ) )
)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.