KNOWLEDGE BASE

Displaying Multiple Formats for a Single Measure in the View


Published: 28 Apr 2016
Last Modified Date: 30 Dec 2016

Question

How to display a measure using different formatting depending on the associated dimensions.

Environment

Tableau Desktop

Answer

Use a calculated field with IF/THEN conditions.
For example, as in the attacked packaged workbook, if you have a dimension, Metric, with values A B C and D, and want the measure to be formatted as a percentage with A and B, but a float with C and D, you would create the following calculated field: 
If [Metric]="A" or [Metric]="B" 
Then 
STR([Number]*100)+"%" else STR([Number]) 
End 

Additional Information

It will usually be necessary to convert measures into strings in order to achieve this result.
 
Did this article resolve the issue?