Bucketing Based on Previous Grouping Results

Hello all,
I am currently trying to achieve the following:

  1. Overtime, perform a number of unique items per account;

  2. Take the unique results and bucket them into a new dimensions;

  3. Based on those dimensions, count back the amount of accounts based on those buckets.

Edit: Managed to solve my issue though a derived table.