In a Tableau line chart, Tableau automatically places null values to 0 (zero) on the X axis.
This is technically incorrect; NULL means the value is unknown, not that it’s zero.
For example, you’re trending this year and the previous years data for sales (or whatever measure) with the months on the X axis and the sales on the Y. If it’s mid-year, future months won’t have any sales data as they haven’t yet happened.
Usually, it is preferable to remove those Null values to tidy the line chart.
The data source contains data up to May of the latest year.
This date is important because in the line charts you see Tableau has included the future values – June to December.
These dates haven’t yet happened, so they don’t exist in the data source. Therefore they are Null, so Tableau assigns a 0 value.
How to remove the Null values from a line chart
However, to hide null values in a Tableau line doesn’t require any functions or anything in any way complex. To remove or hide the Null values, format the green pill on the Rows shelf – the SUM([Sales]) in this example.
Right-click on the pill, select format, opening the Format window.
To remove the Null values from your line chart, select the Pane section of the format window. In this section, at the bottom, notice it has the option ‘Special Values (eg. NULL).
By default Null marks are set to Show. Change this to Hide in the Marks drop down and the Null values will no longer be on your chart.