I have a list with Material, Batch, Quanity, posting date.
User wanted to see only the last line of the posting date.
I did this with a ranking on posting date and then apply a filter to the report only showing the 1’s.
Works just fine.
Now the user wants to see the Quantities for all the posting dates by Material/Batch combi (I made a key that adds material and batch together).
So like a YTD quantity.
I easily fixed that with this formula:
=RunningSum([Quantity]) ForEach([Key])
Also that worked just fine…untill I put back my filter.
The amounts were wrong.
Thanks for giving me this different approach to look at it.
This code will give on every line the grand total.
But indeed if you only will show 1 line per key at a time that will give for that line the correct grand total.
You could get creative and use the two different formula in an if statement based on what data you are displaying. For example, you could use an input control to switch between the two table layouts to display most recent or all.