How to Replace Null Values with Dashes in Tableau

By: Eric Parker

Pro Headshot.jpg

Eric lives in Seattle and has been teaching Tableau and Alteryx for 5 years. He's helped thousands of students solve their most pressing problems. If you have a question, feel free to reach out to him directly via email.

Imagine you work for a company that sells products but not in every market. Because you don’t sell certain products in given markets, you have null values in your data.

Your data might look like this:

95-1.png

(If you are missing rows of data and they don’t show up when they are null, check out this blog post to learn how to create those missing rows).

After turning the data into a highlight table in Tableau it might look like this:

95-2.png

The first step to showing the nulls as dashes is to create a calculated field version of sales that replaces nulls with zeros.

95-3.png

Here’s what that looks like in the highlight table by default:

95-4.png

Next, you click the drop-down next to the Final Sales field in the data pane, select Default Properties and Number Format and input the following:

95-5.png

Notice the effect on the table in the above picture.

Here’s the formatting if you’d like to copy and paste: $#,##0;-#,##0;-

Custom number formatting in Tableau closely resembles custom number formatting in Excel. To learn more, check out this excellent post on Clearly and Simply.