Forum Discussion

thongnguyen2414's avatar
thongnguyen2414
Frequent Visitor
4 years ago
Solved

Variable for Repeatable calculation

Hello   - I really need your advices about the variable for something like Repeatable calculation ( I have no idea if I can call it like this ^^ ) - I am in trouble to calculate column/data for th...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi thongnguyen2414 ,

     

    I'd suggest you create measures instead:

    _1 = 
    var _pre= CALCULATE(SUM('Table'[Q'ty]),FILTER(ALLSELECTED('Table'),[Date]=MAX('Table'[Date])&&  [Op. No]=MAX('Table'[Op. No])-1))
    return IF(_pre=BLANK(),BLANK(),  SUM('Table'[Q'ty]) -_pre)
    _2 = CALCULATE([_1],PREVIOUSDAY('Table'[Date]))
    _3 = [_1]+[_2] 
    _5 = CALCULATE([_3],PREVIOUSDAY('Table'[Date]))
    _6 = [_1]+[_5]

    The final output is shown below:

     

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.