KNOWLEDGE BASE

How To Display Different Measure Value Only When (All) Is Selected In Filter


Published: 06 Apr 2021
Last Modified Date: 13 Apr 2021

Question

How to display different measure only when (All) is selected in a filter?

Environment

  • Tableau Desktop

Answer

The following steps are demonstrated in the attached workbook.
  1. Click Analysis > Create Calculated Field. Save the calculated field named as Values including the following formula.
    IF {COUNTD([Region])}=1 THEN [Discount] ELSE [Sales] END
  2. Place Region to rows and filters.
  3. Right-click Region in the filters pane > Show Filter.
  4. Again, right-click Region in the filters pane > Add to Context.
  5. Place Values to text.
Did this article resolve the issue?