2 Replies Latest reply on Mar 20, 2017 2:16 PM by Tableauuser h

    Date calculations

    Tableauuser h

      Hello I was wondering if anyone could help me. I am completely new to tableau, but need to create some calculations so I can get Firstly month to date, last week, total month, grand totals and week commencing dates. Is there a simple way to do this? Just so I can get my data to show like this.

       

      I Don't have an example to attach unfortunately, but I am hoping these are calculations you can apply to other sheets anyway.

       

      Thank you!

        • 1. Re: Date calculations
          erika.oates.0

          There are a couple of ways that I can think of.

           

          Either set a start and an end date parameter which you can alter to get the values you need by creating a calculated field which is equal to Yes if the date falls within the parameter range, or no if it doesn't. Then filter on this field. See Sheet 1 that I've attached.

           

          Or create a calculated field for each measure you are looking for. E.g., a measure named Current Month which will equal the value field if the date range falls within the current month, and zero if it doesn't. Then drag the measure values and measure names fields onto the worksheet and an aggregate of all the measures in the workbook will appear in the Measure values shelf. You can drag off the ones you don't need. This will enable you to see all your measure values within a single workbook. See sheet 2 in attached. I've only created one of the measures (current month) as an example but the principle is the same for all the others.

          1 of 1 people found this helpful
          • 2. Re: Date calculations
            Tableauuser h

            Brilliant thank you very much Erika!