3 Replies Latest reply on Sep 12, 2016 3:09 AM by Yuriy Fal

    Picking data for previous month

    Himanshu Raunak

      Hello everyone,

       

      I have my data in the following format:

       

      Month
      Category
      Metric
      Jan-16A1
      Jan-16B2
      Jan-16C3
      Jan-16D4
      Jan-16E5
      Feb-16A6
      Feb-16B7
      Feb-16C8
      Feb-16D9
      Feb-16E10

       

      Now, I want to create a new column in Tableau, say Metric1 which would display the value for that category but for the previous month, something like this:

       

      Month
      Category
      Metric
      Metric1
      Jan-16A1
      Jan-16B2
      Jan-16C3
      Jan-16D4
      Jan-16E5
      Feb-16A61
      Feb-16B72
      Feb-16C83
      Feb-16D94
      Feb-16E105

       

      I can use the lookup function to achieve this but the problem is that this new column will be used in a weighted average calculation to roll up the numbers and lookup prevents me from performing a weighted average.

       

      Can anyone please suggest a way to achieve this Month over Month.

       

      Thanks in advance!