This could be done using a parameter and a calculated field. The calculated field would be used in place of the hierarchy dimension. I have attached a sample workbook showing how to do this.
Hope this helps!
hierarchy parameter.twbx.zip 1.1 MB
Thanks Tracy for your help!!.