There are 3 main ways to hide Null values in Tableau. The first is to Format them, second is to Filter them out and third is by Formula. The most appropriate option depends on the circumstances.
1. Format the pill and hide the null values.
Unfortunately this option isn’t always available. Format your Measure pill, go to Pane and hopefully the Special Values will be there.
Select Hide in the Special Values section of the pane. For further explanation I have written about this previously.
2. Drag the pill into the Filter shelf
Filter continuous (green) Null values
Put the continuous pill, for example SUM([Sales]), to the filter shelf. Filter out the null values using the Special section.
In the Special section of the filter you will see Non-null. Select ‘Non-null values’ and it will remove the null values. However this could inadvertently filter out some of the data you want including so be careful when using this.
Filter discrete (blue) values
To filter Null dimensions / discrete measures put the pill to the filter shelf and deselect Null. The Null value will appear in the list with discrete values.
3. Format the Nulls to a different value
There are three formula options to remove / replace Null values.
The Tableau built-in formula IFNULL generally works. The IFNULL formula changes the value of your Null to something else you specify. It could be changed to another field or you can hardcode a value.
For example, to replace Null Country field values with the City value:
To replace Null Country field values with “Unknown”:
ISNULL can be used to create a simple formula to filter out values. For example to filter out the Null Countries create a calculated field with the formula ISNULL([Country]). Selecting False on the filters shelf will keep only those with a non-null value.
ISNULL can also be useful for more complex Null conversions within IF statements. For example, when a value is null you may want to do A and when not null then do B:
IF ISNULL([Field]) THEN A ELSE B END
The ZN function is another alternative for measures. ZN converts the Null to 0 (zero). A quicker way of writing IFNULL. i.e. IFNULL([Sales],0) vs ZN([Sales])
Converting Null by formula is very useful when aggregating, such as a SUM. For example 3 + Null = Null. Often it would be preferable for that sum to equal 3. Therefore the formula could change to 3 + ZN(Null).