There are a couple of things you could try:
1. Probably the easiest, is to use a Relative Date Filter, similar to what's described here: https://onlinehelp.tableau.com/current/pro/desktop/en-us/help.htm#qs_relative_dates.html
2. Create a calculated field and use it as a filter, similar to what's described here: Creating a Relative Date Filter with Slider | Tableau Software
An example of both can be found on the attached workbook using superstore.
Hope this helps!
Dates.twbx 129.2 KB
2 of 2 people found this helpful
I was able to accomplish this, although it was a multi-step process. First, I created two date Parameters to define the End of Year date and the date with which you want the previous 5 business days (or you might use TODAY() instead).
Then, create a logical field in order to filter only weekdays or the end of year date. Add to filter for only True values:
Then, create another logical field to filter out dates after the parameter date and add to filter for only True values:
Next, add INDEX() to the view, compute using Table Down, and sort the dates in descending order:
Lastly, create another logical field to filter for dates that were in the last 5 business dates AND the end of year value. Add to filter shelf and keep only true values:
You can then hide the header for INDEX() and you've got your desired result.
I tried testing this in many different ways, so let me know if this works for you.
1 of 1 people found this helpful
This was exactly what I was looking for - thanks again!