答案 0 :(得分:2)
尝试使用:
=SUM(IIF(Fields!VoucherType.Value = "Income",Fields!Amount.Value,0))-
SUM(IIF(Fields!VoucherType.Value = "Expenses",Fields!Amount.Value,0))
更新: Tablix外的文本框。
如果要显示tablix外部的总数,则需要设置表达式的范围,在本例中为数据集:
=SUM(IIF(Fields!VoucherType.Value = "Income",Fields!Amount.Value,0),"DataSetName")-
SUM(IIF(Fields!VoucherType.Value = "Expenses",Fields!Amount.Value,0),"DataSetName")
将DataSetName
替换为数据集的实际名称。
如果有帮助,请告诉我。
答案 1 :(得分:0)
=SUM(IIF(Fields!TransactionType.Value = 1), Fields!Amount.Value, 0) -
SUM(IIF(Fields!TransactionType.Value = 2), Fields!Amount.Value, 0)