I need the calculation by grouping and account. In other words, the total number of pages should be 2 for the group and the page number would 1 and the second page is 2.

Make sense?