Create calc as
if [measures]="sales" then sum([Sales])
else sum([Profit]) END
Drag this into view.
2. Create calc as
if [measures]="sales" then "Sales"
else "Profit" END
drag this into text in one sheet.
Drag the container first into dashboard.
Drag the sheet and remove the title. Add the 2 calc sheet into top of the sheet.
1.Create a parameter with the sheet names(do sheet swapping).
2.Drag the sheets on to dashboard and hide the title of the sheets.
3.Create a new empty sheet and drag it on to Dashboard as Floating, edit the title of the empty sheet and select insert parameter.
you can see, whatever sheet you select as the title.
There's a great video in this link: Sheet Swapping and Popping with Joe Oppelt (and a Tip on Searching the Tableau Forums) | mluttonbi
And a very powerful and informative blog here: https://www.interworks.com/blog/rrouse/2015/07/07/how-create-dynamic-tableau-dashboard-layouts-sliding-containers
I think having these well written steps and a video to follow will make your life much easier!