This sounds like a request similiar to Dynamic parameters. You might want to review some of the suggestions and work arounds discussed related to that topic in the Idea and by googling Tableau Dyanmic Parameters. The term means different things to different people. I think your example is probably closest to the one mentioned by Interworks here: https://www.interworks.com/blog/daustin/2015/12/17/dynamic-parameters-tableau
I hope that helps.
I did see the interworks example previously and attempted to replicate but feel like there is a step missing in that process. The example twbx doesn't work either. I did find an example that uses a similar process of utilizing a parameter to store values and this example did work for me.
The link is below: