I know this is super old, but I'm sharing this for anyone having the same problem.
It depends on your table and the level of grouping. For example, let's say I have a Details group and two parent groups called "Parent" and "Child".
Parent{
Child{
Details group{
Using just the "RowNumber" function will only return records from a Details group, not from a Row Group. Riegardt was very close, however, even this doesn't account for the level of grouping or null ("Nothing").
If this was to be applied to the group called "Child" in the structure I mentioned above, this wouldn't work.
Also, The count would potentially be inconsistent if there were records in the column with a null ("Nothing") value.
"Count" and "CountDistinct" start their count at zero for null values and one for non-null values (this applies to the "RunningValue" function's parameter as well).
The solution is to include ALL parent groups above the current group you're counting and to not even allow the value from a column to return null in the first place. Here's my solution:
Row Groups within a parent Group:
=RunningValue(IIf(IsNothing(Fields!ParentFieldValue.Value), "", Fields!ParentFieldValue.Value).ToString & IIf(IsNothing(Fields!ChildFieldValue.Value), "", Fields!ChildFieldValue.Value).ToString, CountDistinct, Nothing)
Row Groups with no parent Group:
=RunningValue(IIf(IsNothing(Fields!ParentFieldValue.Value), "", Fields!ParentFieldValue.Value).ToString, CountDistinct, Nothing)