I have attached the tableau work book as well for reference.
2 answers
@swathi karanam
I created a capacity field, but you could also hard code the value or
For the Drop (Qty) + Rollover,
IF (PREVIOUS_VALUE(SUM([Drop]))-[Capacity])<0 THEN SUM(Drop)
ELSE SUM(Drop)+(PREVIOUS_VALUE(SUM([Drop]))-[Capacity])
END
For 'Tail from Previous Day', it is just the previous calculation minus [Drop].
[Drop + Rollover]-SUM([Drop])
James Emery
Tableau Forum Ambassador
Once a response addresses your problem, please click 'Select as Best' so future users can quickly find the answer.