Search code examples
reportingservices-2005

Compute average number of rows per group in Sql Server Reporting Services


I have a table widget in reporting services where I group rows on a given id.

For each group, I display the number of rows per group, using countrows().

How can I display the average number of rows per group at the end of my report ?

What I am missing is : how to count the number of groups?


Solution

  • This is from memory - not sure if this expression is correct:

    = Count(Fields!ID.Value) / CountDistinct(Fields!ID.Value)
    

    Assuming that the "ID" you're grouping by is a single field, that sort of expression should get you what you want.