Tableau Tips & Tricks: Using Parameters to Swap Measures or Dimensions in a View

HomeInsightsBlogs | Last Updated August 11, 2021 - by Softcrylic under data visualization

Published onJanuary 28, 2019

Introduction

Have you ever wanted to use the same visual to analyze results for a different measure or dimension? Rather than creating multiple copies of the same sheet so that you have one for each measure or dimension, you can use Tableau Parameters to dynamically swap fields in a single chart. Using Parameters to select the measure or dimension in a view can greatly reduce the number of sheets in your dashboards and gives your end users more autonomy by letting them choose what results are displayed. Best of all – they are extremely easy to build!

Walkthrough

Below are the step-by-step directions for creating Parameter-based measures and dimensions. These examples use the Sample – Superstore dataset that comes packaged with Tableau Desktop.

  1. Use the menu in the Data pane to create a Parameter.

Tableau Tips & Tricks: Using Parameters to Swap Measures or Dimensions in a Viewhandcursor-icon

  1. Name your Parameter ‘Selected Measure’ and make the following menu selections:
    • Data Type = ‘Integer’
      • We recommend using Integer rather than Float or String because it minimizes the bytes that Tableau has to process
    • Allowable values = ‘List’
  2. Choose which Measures you would like to include in your Parameter and order them according to your preference. We decided to use Sales, Quantity, and Profit in this example.

Tableau Tips & Tricks: Using Parameters to Swap Measures or Dimensions in a Viewhandcursor-icon

  1. Right-click the Parameter and select the ‘Show the Parameter Control’.
    • This helps you keep track of the order of the list (which can be especially helpful when there are many members in the list).
  2. Create a calculated field with CASE WHEN logic that maps each value of your Parameter to the appropriate Measure.

Tableau Tips & Tricks: Using Parameters to Swap Measures or Dimensions in a Viewhandcursor-icon

  1. Use the new Parameter-Based Measure to build your visuals.
  2. Use the ‘Selected Measure’ Parameter to swap the measure in the view.

Tableau Tips & Tricks: Using Parameters to Swap Measures or Dimensions in a Viewhandcursor-icon

  1. Repeat Steps 1-7 to create a ‘Selected Dimension’ Parameter.
    • This example uses Customer Name, Segment, and State.

Play around with an interactive version of this example below and feel free to download a copy of the Tableau Workbook to make your own edits!

Tableau Interactive Graph

Conclusion

Tableau Parameters are powerful tools that allow developers to reduce file sizes and end users to easily customize dashboards to their needs. The walkthrough above covers how you can use Parameters to swap fields in a view, but there are many more applications. We’ll be covering more of them in upcoming blog posts so stay tuned!

Be sure to follow Softcrylic on LinkedIn & check our website for more Tableau Tips & Tricks, more blog posts from our analytics efforts, and information about our products and services.

Tableau Interactive Graph

Conclusion

Tableau Parameters are powerful tools that allow developers to reduce file sizes and end users to easily customize dashboards to their needs. The walkthrough above covers how you can use Parameters to swap fields in a view, but there are many more applications. We’ll be covering more of them in upcoming blog posts so stay tuned!

Be sure to follow Softcrylic on LinkedIn & check our website for more Tableau Tips & Tricks, more blog posts from our analytics efforts, and information about our products and services.

Read more from our Data Visualization practice here.

Softcrylic

Softcrylic is a data consulting firm that is part of Hexaware. We bring a unique combination of strategy and engineering to the ever increasing complex problem of data. We tackle data challenges at the level of data capture and validation through data modeling and activation. We help organizations further benefit and understand their data through our engineering expertise on Microsoft Azure and Amazon AWS alongside Hexaware’s extensive experience and capacity in Engineering and AI.

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Not readable? Change text. captcha txt

Start typing and press Enter to search