Showing Today's Date when no Data in Tableau

Rajeswar Rayapati
4 min readNov 1, 2020

I have seen many people asking this one question “ How to display Date or Text when there is no there are no records or zero records in the Database.

Well, when it is Tableau there are many ways. Here, I am going to provide one solution to it.

Let us Take Super Store Data to do the same and to filter out all the records, we use one Calculation named as Only Today with formula as
[Order Date] = Today()

Formula to filter all the records

Now use this Calculated field as Data Source Filter so that you will get 0 records into Data Source as shown in the image below

Exclude to remove all the False values

As the data in Superstore is till 2019, you will not get TRUE option in the filter. Hence we Select FALSE and then select Exclude.

Datasource page after using Data Source Filter

If you see the above image, we don't have any Data in the Data source page. Now come to worksheet and Drag any field you want, it will give you a blank page.

In the Worksheets we cannot do anything to get Today’s Date. This is because Worksheet always works on the Rows of Data which we don’t have any right now.

So, we are left with Dashboard only. But even in Dashboard how to get Current Date dynamically every time we open the workbook?

This is where I was struck for Days but finally it struck me that we can use Parameters for the same. But how to get the Current Date Dynamically?
Yes!! what you think is right. We can use Today() function for the same.

So I have created a Calculated Field with Today() and named it as Current Date

Now create a Parameter and Name it as Current Day Today and select the Options as below

Data Type: Date
Current Value: Tableau will display Today Date by default
Value when workbook Opens: Current Date (Remember not to select Current value here)
Display Format: Choose the format that you want
Allowable Values: All

Options to Select in the Parameter

I am reminding again. It is very important to select Current Date in “Values when Workbook opens” otherwise Date will not change dynamically.

We have all that we need. Now open a new Dashboard and Drag a Text Box that is present in the Objects to the Dashboard.

Objects in Dashboard

In the Text Box, click on Insert and Select the Parameter that we created earlier “Parameters.Current Day Today”

Text box with Parameter

Using the option in Text box, change the Size, Font, Color, Alignment and others as per your needs and click on OK.

Final Output.

Voilaa!! we have achieved it.

But we are not done yet. We have to see if this changes with the change in Date Field or not. So, I have changed my system Date setting to 2nd Nov 2020 and then Saved the Workbook and reopened it and yes it is working for me.

But again this will work only when you select Current Date instead Current value in the Parameter.

P.S: If you want you can change the Date format that is being displayed by changing the Display Format option in the Parameter.

Hope you liked it guys.

--

--

Rajeswar Rayapati

I am MAD about Tableau especially LODs. To spread that love on Tableau, I started Scenario Based Tableau Training. Call +91 9121314333 for details