Forum Discussion
thongnguyen2414
4 years agoFrequent Visitor
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...
- Anonymous4 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.
Ehren
4 years agoMicrosoft Employee
Are you trying to do this in Power Query/M or in DAX? (This is the area of the forum for PQ questions.)