SSRS 表达式 - 根据条件求和,如果求和 return 为空,则无法将其设为 return 零

SSRS Expression - Sum based on condition, unable to get it to return zero if sum returns null

我正在 SSRS 中创建一个表达式,用于计算满足条件的天数。

我目前使用的表达式:

=Sum(IIF(Fields!Charge.Value = "Chargeable" AND Fields!Progress.Value = "Booked", Fields!Number_of_Days.Value, Nothing), "DataSet1")

I have tried using some suggestions such as 'IsNothing' but trying to copy the same sort of formatting as other answers has given me a "#ERROR" when the report is run.

但是,这可能是因为我在尝试此操作时格式错误。

封面设计视图:

运行 报告:

如您所见,出现的值 100% 正确 - 已经过双重检查。只想显示零而不是空白。屏幕截图中出现零的原因是因为在此(实际报告)下方显示的数据中,天数列显示为零。我无法显示此数据,因为它很敏感。

我需要使用完全相同的表达式,但如果 returns 为空或零,则能够显示零。

感谢任何帮助,谢谢。

应该有效的临时修复:

=ROUND(Sum( IIF(Fields!Charge.Value = "Chargeable" AND Fields!Progress.Value = "Booked", Fields!Number_of_Days.Value, Nothing) , "DataSet1"), 2)

我不知道这将如何影响数据,但这是一个很好的解决方法,可以让它显示 0.00。