Loading

How to Create a Dynamic Tooltip to Display Different Values for Different Measures

Udgivelsesdato: Apr 13, 2024
Opgave

How to create a dynamic tooltip to display different values for different measures?

For example, when using Measure Names to display several values, how do you alter the Tooltips data based on the Measure you selected?
User-added image
 

 

 

Trin
Using a parameter action can achieve this function as shown below and demonstrated in the attached package workbook.

1. Create a string parameter with the name _Measure Names as shown below:
User-added image

2. Create a calculated field with the name _Measure Sum to show the SUM of measures with the below calculation:
     *Note: the { SUM([Sales])} is the short version for {FIXED: SUM([Sales])}
IF [_Measure Names]="Sales" THEN { SUM([Sales])}
ELSEIF [_Measure Names]="Profit" THEN { SUM([Profit])}
ELSEIF [_Measure Names]="Quantity" THEN { SUM([Quantity])}
END

3. Create a parameter to transfer the hovered Measure Names to the _Measure Names parameter as shown here:
User-added image

4. Add the calculation _Measure Sum to the tooltip and edit the tooltip to show the dynamic SUM for different measures as demonstrated below:
User-added image

Please check the attached workbook for details.
Yderligere ressourcer
Details for the FIXED calculation can be found in this Tableau Online Help for FIXED Level of Detail Expressions.
Vidensartikelnummer

001456803

Vedhæftede filer

dynamic tooltips_v2022_4.twbx

1170 KB

 
Indlæser
Salesforce Help | Article