You have 2 questions:
1. How to show the dates. Create 2 calculated fields:
- ToOrderDate with the formula TODAY()
- FromOrderDate with the formula DATEADD('day',-90,TODAY())
Place these on the Detail shelf of your Bar chart, then edit the title of the bar chart adding the text you want and inserting the calculated fields.
2. How to show the current date in the filter. This is trickier but if you want the filter to always be based on the past 90 days you can create a relative date filter - just make sure your date filter is continuous (green) and set it up to show the last 90 days then as time passes by your filter always is showing the latest 90 days without the user having to change anything. The user is able to see the dates that are on display in the title of the bar chart.
hi watson ,
thanks for your quick reply , if possible can you please share any sample twbx.
I don't have tableau handy at the moment. My suggestion is quite straightforward to implement. What are you struggling with?
Sent from Samsung Mobile
you can try this below.
1. create a parameter named "param_Today", as shown below
2. create calculated fields
(b) Date_20_days_below = DATEADD('day',-20,[Date_TO])
+ "/" +
+ "/" +
IF([Order Date]>= DATE([Date_FROM]) AND [Order Date]<=[Date_TO])
THEN 1 ELSE 0 END
find the attached workbook for complete details.
last20daysSales.twbx 409.9 KB