0

I am trying to write an expression using two separate fields: Fields!StmnPrice.Value and Fields!StmnUnits.Value. The expression is in a text box under a column labeled "Billed Units." I want Billed Units to display the sum of only the statement units that have a value of statement price <> 0 for any given matter (there are multiple statement units entries for any given matter). I currently have the below expression, which only excludes the units with statement price of 0 if all entries for that matter have statement price of 0. Otherwise, the sum includes all statement units regardless of statement price.

=IIF(Fields!StmnPrice.Value = 0, Nothing, sum(Fields!StmnUnits.Value))

I also tried the below expression, which is effective at excluding all statement units with a statement price of 0 but does not sum all statement units with statement price <> 0 for any given matter.

=IIF(Fields!StmnPrice.Value = 0, Nothing, Fields!StmnUnits.Value)

Any help is appreciated. Thanks!

1 Answers1

0

I was putting my "sum" in the wrong place. The expression works when I write it as follows:

=Sum(IIF(Fields!StmnPrice.Value = 0, Nothing, (Fields!StmnUnits.Value)))