There are a couple of things to look at here.
First, you specify the Scope of "Details"
in your RunningValue
expression... By default this group will have no grouping value, i.e. each row in the dataset will be in its own group. Which means the RunningValue
will only ever be applied to one row only. Change the Scope to "MyDataset"
or Nothing
, whatever is appropriate.
Secondly, you need to consider how the InOut
field affects the RunningValue
.
I have created a simple Dataset:
And a simple table:
The Balance
expression is:
=RunningValue(IIf(Fields!InOut.Value = 0, Fields!QTY.Value, Fields!QTY.Value * -1)
, Sum
, Nothing)
You can see this changes the Scope from your original statement, and also applies a multiplier to QTY
based on InOut
.
Works OK for my sample data: