I am using SSRS 2008 and trying to calculate the following percentage in my tablix:
sum(Fields!Last14Days_Ct.Value) / countdistinct(Fields!Client.Value)
So Last14Days_Ct can be = 1 or 0. I want to sum all of these integer values. Client field is a VARCHAR, and there can be multiple rows / Client. So what I want to do is to calculate the % of Clients within the last 14 days. In other words, each Client has one field "Last14Days_Ct" = 1 or 0. So I just want to calculate the percentage of clients that happened in last 14 days. Here is the SSRS formula I tried right now:
=iif(countdistinct(Fields!Client.Value)=0,0,sum(Fields!Last14Days_Ct.Value)
/iif(countdistinct(Fields!Client.Value)=0,1,countdistinct(Fields!Client.Value)))
And I grouped that row on Fields!Last14Days_Ct.Value.
But problem is that now when I view it in ReportViewer, it shows 2 rows: when Last14Days_Ct = 1 and 0. I only want the row where it = 1 to appear. But if I apply a filter to that group on = 1, it always shows 100%. How can I properly calculate this value please?