6 Replies Latest reply on Nov 1, 2018 6:48 PM by Shinichiro Murakami

    Is previous Month Calculation in a Date data table supposed to work

    Diego Navarro

      Tableau Desktop 2018.2.0

       

      Hello guys

       

      I need to create a report with following requirements (attached twbx) :

       

      1- It has to be a data table

      2- Daily basis

      3- A whole month shown as a day list

      4- Availability of filter between different months

      5- A dynamic view to select between 2 Measures (Sales and Previous Month Profit)

       

      I have developed all of the requirements successfully but the number 5, specifically Previous Month Profit. Most of the formulas I've tried does not work with filtered dates, like for example:

       

      Previous Month Profit =

      "lookup(sum([Profit]),-30)"

       

      This only works when I have 2 months in the view, otherwise does not show anything, as per the requirement number 3, the report can only show 1 month. The same thing happens with other formulas like Datepart, Datediff, dateadd, etc.

       

      So in summary the question I got is: How to show Previous month Profit and fullfilling all the requirements previously mentioned.

       

      Any comment or question will be appreciated.

       

      Best Regards