If(
thisRow.[Exit - Avg Price Over Ride (USD)].IsBlank(),
Sum(
[Position Changes].Filter(
Postion = thisRow AND
CurrentValue.[Add or Subtract?] = [Subtract from Position]
).[Cost or Earnings (USD - Lev'd)]
),
If(
thisRow.[Position - Direction] = Long,
thisRow.[Exit - Avg Price Over Ride (USD)]*thisRow.[Calc - (C) - Total Number of Tokens (Lev'd)],
thisRow.[Calc - (C) - Total USD In (Lev'd)] + (thisRow.[Calc - (C) - Total USD In (Lev'd)] - thisRow.[Exit - Avg Price Over Ride (USD)]*thisRow.[Calc - (C) - Total Number of Tokens (Lev'd)])
)
)