4 Replies Latest reply on Sep 30, 2015 7:18 AM by Santhosh Thadakamalla

    Parameter to Show or Hide Measures

    Ed Kukec



      I'm trying to show/hide measures based on selecting a value in a parameter. Essentially, I have 3 measures:


      1. Volumes

      2. Population

      3. % (calculated field = volumes/population)


      I want a parameter that allows you to show or hide the above measures based on your selection. I can add measure values as a quick filter but it ends up showing "Population" which is a measure I don't want the user to be able to see or select. However, when I try and hide the "Population" measure I can't because it's being used in the "%" calculated field.  How do I create a parameter, called [Select Measure] with two values: "Volumes" and "Percentage" and based on what you select it shows or hides the measures above.  So if the [Select Measure] parameter = "Volumes" it will only display the "Volumes" measure on my dashboard.


      Any help would be appreciated.




        • 1. Re: Parameter to Show or Hide Measures
          Tracy Rodgers

          Hi Ed,


          First, a string parameter should be created that lists out the measures: Volumes, Population, %


          Then, a calculated field should be created similar to the following:


          case [Select Measures Parameter]

          when 'Volumes' then sum([Volumes])

          when 'Population' then sum([Population])

          when '%' then [Calculated Field]



          Finally, place the dimension on the view, and place the above calculation on the text shelf (or other location on the view). Right click on the parameter and select Show Parameter Control.


          Does this answer the question? If Population is not wanted as a selection, simply don't put it in the parameter or calculation.



          1 of 1 people found this helpful
          • 2. Re: Parameter to Show or Hide Measures
            Ed Kukec

            Hi Tracy,


            Thanks for the reply. This almost works but here's the problem. When I set the format for the % to Percentage, it also converts the Volumes measure into an enormous percentage so this won't work. There has to be a way just to show or hide a field depending on the paremeter choice.

            • 3. Re: Parameter to Show or Hide Measures
              Joe Mako

              If you are just displaying text you can use a formula to format the result differently based on the parameter.


              see http://community.tableau.com/thread/109893 for some of the options


              If you want an axis formatted differently based on the parameter selection, then you can use the parameter to effectively switch the sheet out with a layout container on a dashboard.

              • 4. Re: Parameter to Show or Hide Measures
                Santhosh Thadakamalla

                Hello Tracy,Joe Mako


                Thanks for your solution. This has been posted long back but i have similar requirement with different parameter selection.


                Let's take same example mentioned above, we have parameter control on date .. if user selects one month range date in parameter control then 'Volumes' and '%' measures should display ... same way if they select 6 months range date then only 'population' measure should get displayed. I am not sure if this is possible. Currently we are using Tableau 9 version.


                Please help me if you have any solution.