Forum Discussion
Transaction Level Running Total
Thanks for the reply, Icey. Let me be a bit more specific about the error I'm trying to fix. See the table below for more info:
Date Product Ref No Qty Before Movement Qty After
10/02/17 03885 7065503 1455 +4 1459
10/03/17 03885 7071406 1459 -2 1454
10/03/17 03885 7071433 1459 -2 1454
10/03/17 03885 7071908 1459 -1 1454
My main problem is with the calculation of the Qty Before (in red above). Here is the desired outcome:
Date Product Ref No Qty Before Movement Qty After
10/02/17 03885 7065503 1455 +4 1459
10/03/17 03885 7071406 1459 -2 1457
10/03/17 03885 7071433 1457 -2 1455
10/03/17 03885 7071908 1455 -1 1454
And here is he formula for the Qty Before measure:
Hi Eric ,
I reproduce your question, and I think the results are correct. Can you share your PBIX to me if possible? Or a similar one. Then I can help you better.
Quantity_Reverse 2 =
CALCULATE ( SUM ( 'TMHIST'[Movement] ), ALLSELECTED (), ALL ( TMHIST[Ref No] ) )
- CALCULATE (
SUM ( 'TMHIST'[Movement] ),
ALLSELECTED (),
FILTER ( ALL ( TMHIST[Ref No] ), TMHIST[Ref No] < MAX ( TMHIST[Ref No] ) )
)Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Eric7 years agoAdvocate I
Thanks for you help. In the end, I was able to solve the problem by coming at it from a different direction and didn't have to use this formula after all.