Forum Discussion
ifenek
4 years agoFrequent Visitor
Projected stock calculation help
Hello, I need help, I'm trying to implement a stock projection calculation in place. What I'm looking to do is to say if I have enough stock to despatch a product. For that i'm looking at prev...
MFelix
4 years agoSuper User
Hi ifenek ,
Trythe follwoing code:
Result =
SUM ( Example[availableforassembly] )
- IF (
SELECTEDVALUE ( Example[duedate] )
<= MAXX (
FILTER ( ALL ( Example ), Example[duedate] < MAX ( Example[duedate] ) ),
Example[duedate]
),
SUM ( Example[remaingquantity] ),
CALCULATE (
SUM ( Example[remaingquantity] ),
FILTER ( ALL ( Example ), Example[duedate] < MAX ( Example[duedate] ) )
)
)
Be aware that this may need some changes, because I'm not sure if I understood your requirements especially on getting the previous value.