Displaying total and percentage group wise

• Question

• Hi All,

I have a table in which I want to show all the schools ( a field in my table) the participants have enrolled in, the no of students in each school and its percentage. I can show the rows grouped on my school name and use the count function to get total for each school, but I am not sure how to get the percentage here?

For eg.

Student School

Priya BCD

Lucky ABC

Rama BCD

So, in my SSRS report it should show like

School Count Percentage

ABC 2 50%

BCD 2 50%

Thanks a lot.

Prags

Tuesday, May 28, 2019 9:54 AM

• Created a data set "DataSet1" as below

select 'Adam' AS Name ,'ABC' AS School UNION

select 'Priya' AS Name ,'BCD'AS School  UNION

select 'Lucky' AS Name ,'ABC' AS School UNION

select 'Rama' AS Name ,'BCD' AS School

Added a tablix and group by School

Add the expression for Percentage column in the tablix as below

=(COUNT(Fields!Name.Value, "Details")/COUNT(Fields!Name.Value, "DataSet1"))*100

where "Details" is the group name and "DataSet1" us the data set name

Suresh
My Scribbling

• Proposed as answer by Wednesday, May 29, 2019 1:17 AM
• Marked as answer by Wednesday, May 29, 2019 3:37 AM
Tuesday, May 28, 2019 10:24 AM

All replies

• Created a data set "DataSet1" as below

select 'Adam' AS Name ,'ABC' AS School UNION

select 'Priya' AS Name ,'BCD'AS School  UNION

select 'Lucky' AS Name ,'ABC' AS School UNION

select 'Rama' AS Name ,'BCD' AS School

Added a tablix and group by School

Add the expression for Percentage column in the tablix as below

=(COUNT(Fields!Name.Value, "Details")/COUNT(Fields!Name.Value, "DataSet1"))*100

where "Details" is the group name and "DataSet1" us the data set name

Suresh
My Scribbling

• Proposed as answer by Wednesday, May 29, 2019 1:17 AM
• Marked as answer by Wednesday, May 29, 2019 3:37 AM
Tuesday, May 28, 2019 10:24 AM
• Thanks for the quick help, Suresh.

Prags

Wednesday, May 29, 2019 3:38 AM