KNOWLEDGE BASE

How to Show Missing Values as Zero in Step Line Graph


Published: 23 Dec 2020
Last Modified Date: 23 Dec 2020

Question

How to show 0 in the step line graph when there is no data.
For example, for a series of data from 12/1 ~ 12/6 without data in 12/4 and 12/5, how to show 0 in the step line graph for 12/4 and 12/5.

Environment

  • Tableau Desktop

Answer

Option 1: Use a discrete Date field

  1. Drag the Date field into [Columns] and set it as discrete MDY.
  2. Right-click the Date date ad select [Show Missing Values] in the drop-down menu.
  3. Create a calculation field for showing 0 when there is no data as ZN(SUM([Value]))
  4. Drag the newly created value field to [Rows]
Please check the attached video for more details.

Option 2: Use a continuous Date field

  1. Drag the Date field into [Columns] and set it as continuous Day.

  2. Right-click the Date date ad select [Show Missing Values] in the drop-down menu.

  3. Create a calculation field for showing 0 when there is no data as ZN(SUM([Value]))

  4. Drag the newly created value field to [Rows]

  5. Right-click the value field and select [Edit Table Calculation]

  6. Set the table calculation as below

User-added image
 

Did this article resolve the issue?