KNOWLEDGE BASE

Formatting Conditional Decimal Precision


Published: 20 Sep 2017
Last Modified Date: 21 Sep 2017

Question

How to conditionally format decimal precision (for example: 3 decimal places for values under 1 and 0 decimal places for values over 1).

Environment

Tableau Desktop 9.2.4

Answer

Use the ROUND function as follows:
 
IF ABS([Value]) >1
THEN 
ROUND([Value]) 
ELSE
ROUND([Value],3) 
END 
 
Then set the default number format to Number (Standard)
Did this article resolve the issue?