How to calculate percentage under each group in SSRS?

  Kiến thức lập trình

I want to calculate the percentage for paper and online group. The total should be 100%

I have one column group and row group. The column group has title with expression like

=IIF(Fields!SOURCE.Value = "Fax", "Paper Percentage", IIF(Fields!SOURCE.Value = "Web", "Online Percentage", ""))

My current results showing either 100% or 1 for both.(like below)

enter image description here

I have tried using below expression but both does not working as I said either showing 1 or 100%

=CountDistinct(Fields!SOURCE.Value) / CountDistinct(Fields!SOURCE.Value,"SOURCE1")
=IIF(Fields!SOURCE.Value = "Fax", 
     Format(Sum(IIF(Fields!SOURCE.Value = "Fax", 1, 0)) / Sum(Count(Fields!SOURCE.Value)) * 100, "N2") & "%",
     IIF(Fields!SOURCE.Value = "Web",
         Format(Sum(IIF(Fields!SOURCE.Value = "Web", 1, 0)) / Sum(Count(Fields!SOURCE.Value)) * 100, "N2") & "%",
         ""))

How do I calculate both percentage based on which group they belongs to?

Please let me know if I need to add more details.

Thanks so much!

LEAVE A COMMENT