8 Replies Latest reply on Feb 22, 2017 1:24 PM by Shinichiro Murakami

    How to calculate current year and last year values for a measure.

    Kim Roger



      I am a beginner and am trying to learn the basics on Tableau.

      I have a requirement where i have a measure "Sales" and Dimension "Year",

      I need to calculate "Chg Sales" column to be displayed in a table.

      calculation for "Chg Sales" = ( Current Year Sales - Prior Year Sales)


      Year values





      User filters on year, Only year 2015 and 2016 are visible for selection. Always the current year and prior year are only displayed for filter selection by users.

      If user select 2016 "Chg Sales" = ( 2016 Sales - 2015 Sales)

      If user selects 2015 " Chg Sales" = (2015 Sales- 2014 sales)


      I need to calculate this dynamically as the year will change.