title: Reporting Services: Show top N Rows with Grouping
body: <p>I am trying to show the top 10 rows in my report. I can do this by setting the following expression for the Visibility of the row group: </p>
  
  <p><code>=IIF(RowNumber(Nothing) &lt;= 10, false, true)</code></p>
  
  <p>and then sorting the table on the top numbers.</p>
  
  <p>In my query I get two rows for each result, with different results. The problem is that I want to group these rows into one row in the report without losing the count for top X rows. But when I group on the name in my report in Visual Studio, it only shows every row one time and the count for X rows get incorrect. Sometimes I have the same name once and sometimes twice. I have tried to set the expression to 20 rows, but then I might get 12 rows sometimes and 10 rows sometimes, depending on how many rows for each name my query returns.
  Thanks in advance,
  Sara</p>