Reporting services SSRS-使用基于布尔字段结果的COUNTDISTINCT

Reporting services SSRS-使用基于布尔字段结果的COUNTDISTINCT,reporting-services,count,expression,Reporting Services,Count,Expression,我有一个RetailLocation的布尔字段,根据该字段是否为真,我想计算保存商店ID的CustomerLocation字段的不同值。总的结果是获得每个位置调用的平均值。 到目前为止,我有以下错误,但我得到了这个错误: 未为类型“Field”和“Boolean”定义运算符“=” =COUNTDISTINCT(IIF(Fields!RetailLocation.Value=true, Fields!CustomerLocation.Value, Nothing),"MonthlyIncident

我有一个RetailLocation的布尔字段,根据该字段是否为真,我想计算保存商店ID的CustomerLocation字段的不同值。总的结果是获得每个位置调用的平均值。 到目前为止,我有以下错误,但我得到了这个错误: 未为类型“Field”和“Boolean”定义运算符“=”

=COUNTDISTINCT(IIF(Fields!RetailLocation.Value=true,
Fields!CustomerLocation.Value, Nothing),"MonthlyIncidentReviewRetailLogged")/
SUM(IIF(Fields!RetailLocation.Value=true,1, 0),"MonthlyIncidentReviewRetailLogged")

在这里踢我自己,当我发布时注意到我丢失了RetailLocation的值。如果你还没有解决这个问题,请尝试更改
字段!RetailLocation.Value=true
用于
字段!RetailLocation.Value=1