KNOWLEDGE BASE

How To Swap Multiple Measures Using Parameter


Published: 24 Feb 2021
Last Modified Date: 24 Feb 2021

Question

How to use a parameter to swap between multiple measures and one measure.

User-added image    User-added image

Environment

  • Tableau Desktop

Answer

  1. Create a Parameter to swap between one measure and multiple measures. e.g. Swap between [Sales] and [Discount Rate] + [Profit Ratio]
  2. Create Calculation fields to swap the measures, such as:
    • CASE [! Swap]
      WHEN "Discount Rate and Profit Ratio" THEN [Profit Ratio]
      END
  3. Add [Measure Values] to [Rows] and add [Measure Names] to [Color].
  4. Show parameter and swap values.
Did this article resolve the issue?