2 Replies Latest reply on Aug 13, 2018 7:26 AM by Simon Jacobs

    Help with doing YoY comparison for YTD - without using Today() function

    Simon Jacobs

      Hi everyone,


      I'm struggling to calculate a YoY comparison for YTD data.  I've seen several discussions on the forum but they don't solve my problem.


      In the attached workbook I want to compare the social interactions data for 2018 so far to the same period in 2017 (Jan-Apr).  The main issue I'm having is that I don't receive data on a regular basis - hence my current data file is awaiting an update and only has data to the end of April 2018.  Consequently if I were to use functions like 'today ()' to filter data I get more data for 2017 than I do for 2018.


      I've created a measure to work out the latest month in the year - it returns '4' for 2018 and '12' for 2017.  I'm struggling to see how to then apply the '4' (April) to both the 2017 and 2018 data to filter it to Jan-Apr.


      Any help much appreciated!


      I'm using Tableau Desktop 10.3.