4 Replies Latest reply on Oct 3, 2016 5:14 AM by Nagaraju Kurella

    Date selection

    Koti D

      Hi ,


      i have category sales bar chart , i want to show the last 90 days data from todays date, i want to show the from and to date in bar chart , in TO date i want show today() date , when ever user opens the work book i want show that date in TO date filter , and in from date i want show 90 days back date.


      Sample data:

      Sample data.PNG                

      i want to o/p like this :

      suppose  user today opens the dashboard i want like this in dashbord : from order date :    01/07/2016    to order date :01/10/2016

      suppose if he opens the dashboard on 12/10/2016 i want to like this    :from order date :    12/07/2016    to order date :12/10/2016

      when ever user opens the dashbord i want show the current date in to date filter.


      how to achive this?

        • 1. Re: Date selection
          Andrew Watson

          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.

          • 2. Re: Date selection
            Koti D

            hi watson ,

            thanks for your quick reply , if possible can you please share any sample twbx.

            • 3. Re: Date selection
              Andrew Watson

              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



              • 4. Re: Date selection
                Nagaraju Kurella

                Hi Koti,

                you can try this below.

                1. create a parameter named "param_Today", as shown below


                2. create calculated fields

                    (a) "Date_TO"

                    Screenshot 2016-10-03 15.04.19.png

                (b) Date_20_days_below = DATEADD('day',-20,[Date_TO])

                (c) Date_FROM


                          + "/" +


                          + "/" +


                  (d) Show_last_90_Days_Sales

                      IF([Order Date]>= DATE([Date_FROM]) AND [Order Date]<=[Date_TO])

                          THEN 1 ELSE 0 END


                find the attached workbook for complete details.


                Regards, Naga

                1 of 1 people found this helpful