You can use the DENSE_RANK function this will give the next value whenever the record value is changed then on top of that use the running count
Sent from my iPhone using Tapatalk
Sent from my iPhone using Tapatalk