KNOWLEDGE BASE

Displaying Weeks as the Last Day of the Week


Published: 18 May 2017
Last Modified Date: 19 May 2017

Question

How to change the display date for the week date level to last date of week rather than the first.

Environment

Tableau Desktop

Answer

The attached example workbook uses the sample data set Superstore to demonstrate the following two options:

Option 1: For discrete week bins

  1. Create a calculated field named "End of Week Display Date" and add a formula similar to:
    	DATEADD( 'day', -1, DATEADD( 'week', 1, DATETRUNC( 'week', [Order Date] )))
    • NOTE: Starting from the inside out, the above calculation first truncates dates to the first day of the week. Then the DATEADD() function adds 1 week, which will move the dates to the first day of the following week. And finally we subtract one day, which will move the dates to the last day of the original week.
  2. Right-click and drag [End of Week Display Date] to the Rows shelf
  3. In the Drop filed dialog, select MDY(End of Week Display Date)
Note: using the week date level with [End of Week Display Date] will make Tableau Desktop display the first day of the week again.


Option 2: For continuous data axes

  1. Right-click on the date axis in the view and select Edit Axis…
  2. In the "Edit Axis" dialog, do the following and click OK:
    1. Navigate to the "Tick Marks" tab.
    2. For "Major tick marks", select Fixed.
    3. For "Every" select 1 Weeks.
    4. For "Tick Origin" select any date that is the last day of that week.
Note: this date does not have to be present in the data or in the view.
Did this article resolve the issue?