Thanks for the reprex, I understand your issue now!
I recently helped a user with a very similar question in this post:
Take a look at my code there and see if this will give you your answer. If not just let me know why is didn't work and we'll explore the issue further.