3 of 3 people found this helpful
So the lack of dynamic formatting in Tableau (for measure selectors) is a bit of a pain...you may want to vote this idea up!
however there is a workaround....
In the attached I've got a measure selector which returns Sales (£) or Share of Sales (%). I set up 2 calcs
[Select Measure: Sales]
IF [Select Measure] = 1 THEN SUM([Sales]) END
[Select Measure: %age Share]
IF [Select Measure] = 2 THEN SUM([Sales]) / TOTAL(SUM([Sales])) END
as there is no ELSE statement then when one is selected the other returns NULL (and Tableau doesn't, well can't - no one can!, plot nulls!). So I set up the formatting for one as £ and the other as %age...and bring them both into the Label, and set it up as per the below
and voila we have dynamic formatting!
Hope that does the trick and makes sense.
Simon! Thank you so much! It is really great!!!
1 of 1 people found this helpful
Cool, glad it did the trick!
This is the same (basic) technique to do things like applying colours and formatting in ToolTips...eg. make one calc: IF [var on Sales] >= 0 THEN [var on Sales] END and then another calc: IF [var on Sales] < 0 THEN [var on Sales] END...put them side-by-side (in the tooltip), make one green and one red, and when someone hovers over, they'll get a Red if its negative, and Green if it's positive!