Last modified date: 20 Jul 2023
Environment
Tableau DesktopAnswer
Option 1 - Using a Calculated Field
Step 1 - Create a calculated field for the text
- Select Analysis > Create Calculated Field...
- In the Calculated Field dialogue box that opens, do the following and then click OK:
- Name the calculated field. In the example workbook, the calculated field is named Statement Text.
- In the formula field, create a calculated field similar to the following:
CASE [Region] WHEN "Central" THEN "This is the Central Example" WHEN "East" THEN "This is the East Example" WHEN "South" THEN "This is the South Example" WHEN "West" THEN "This is the West Example" END
Step 2 - Create the dashboard
- Create a new Sheet called "Example 1".
- Drag Region to Rows and Profit to Columns.
- Create a new Sheet called "Example 2".
- Drag Region to Rows and Category to Columns.
- And drag Profit to Text.
- Create a new Sheet called "Statement".
- Drag "Statement Text" to the Text card.
- Drag the 3 new created sheets into a new dashboard.
- Adjust the size of each sheet as necessary to fit the dashboard.
Step 3 - Create an action filter
- Select Dashboard > Actions...
- Select Filter...
- Name the field, for example: Text
- In the Source Sheets, tick only the worksheets that will be clicked to filter the Statement worksheet (in this example, select Example 1 and Example 2)
- In the "Run action on" menu, choose the Select option.
- In the Target Sheets section, tick only the Statement worksheet (in this example, select Statement)
- Set the "Clearing the selection will:" option to Exclude all values.
- Make sure that the "Target Filters" option is set to All Fields.
- Click OK.
- Click OK.
Option 2 - Using a parameter
Step 1 - Create a Parameter
- Click the arrow next to the Dimensions panel and select Create a parameter.
- Name the parameter "Choose a measure".
- In the Data Type, choose String.
- In Allowable Values, select List.
- In the List of Values add the measures that you want to filter.
- In this example, add Discount, Profit, Profit Ratio, Quantity and Sales.
- Click OK.
Step 2 - Create a calculated field for the text
- Select Analysis > Create Calculated Field...
- In the Calculated Field dialogue box that opens, do the following and then click OK:
- Name the calculated field. In the example workbook, the calculated field is named Display Measure.
- In the formula field, create a calculated field similar to the following:
CASE [Choose a measure] WHEN "Discount" THEN SUM([Discount]) WHEN "Profit" THEN SUM([Profit]) WHEN "Profit Ratio" THEN [Profit Ratio] WHEN "Quantity" THEN SUM([Quantity]) WHEN "Sales" THEN SUM([Sales]) END
Step 3 - Create the dashboard
- Create a new Sheet called "Parameter Example".
- Drag "Region" to Rows and "Display Measure" to Columns.
- Right click on the parameter "Choose a measure" and select Show Parameter control.
- Create a new Dashboard and drag the Parameter Example sheet.
- Drag a Text Tiled Object.
- Add the text of your choice and click Insert <Parameters.Choose a measure>.
- Interact with the parameter control.
Additional information
To view these steps in action, watch the video below:Thank you for providing your feedback on the effectiveness of the article.
Open new case
Continue searching
Knowledge Base
Community
Product help
Training and tutorials