KNOWLEDGE BASE

Displaying Missing Values as Strings for a Measure


Published: 01 Feb 2018
Last Modified Date: 09 Jul 2018

Question

How to display missing values as strings, like "N/A" or "Null", for a measure in a table.

Environment

Tableau Desktop

Answer

Create a calculated field similar to the following and replace the Measure in the view.

IF LOOKUP(ZN(SUM([Measure])),0) = 0
THEN 'N/A' ELSE STR(SUM([Measure])) END

Additional Information

Additional string formatting may be required because the measure is effectively turned into a string, so any integer formatting is lost. More information about this topic can be found in the following Community Forums post: How to replace "No values" [Not Nulls] with N/A
Did this article resolve the issue?