We help IT Professionals succeed at work.

Trying to sum in group footer based on condition

I have one footer value in my report that is based on an expression

Expression:
=Fields!amount.Value - SUM(Fields!BudgetByProduct.Value)

I have a parent grouping with a footer and need to SUM based on a condition. I tried this

=Sum(IIF(Fields!IsOpt.Value = 1, Fields!amount.Value - SUM(Fields!BudgetByProduct.Value),NOTHING),"DataSet1")

I cannot use inner and outer aggregates when in association with a dataset. Does anyone know how I could compute this value?
Comment
Watch Question

Director, Practice Manager and Computing Consultant
Awarded 2014
Top Expert 2014
Commented:
Try this:
 
=Sum((Fields!amount.Value - Fields!BudgetByProduct.Value) * iif(Fields!IsOpt.Value = 1,1,0),"DataSet1")