2 Replies Latest reply on Jan 16, 2019 7:58 AM by Joe Oppelt

    Calculate Latest Data in Range only

    Andrew Kent

      Hi all,

       

      I'm new to the forums and indeed Tableau. My background is in Excel/DAX/Power BI so please bear with me while I try to describe what I am looking to do. I have data ranging from 01/01/2009 to 31/12/2018 and I have a calculation that allows me to count hires for each year;

       

      IF

          (DATEDIFF('year',[Start Date],[Record Date]) = 0) AND ([Status] = "ACTIVE")

      THEN

          1

      ELSE

          0

      END

      I have setup parameters that allow me to have sliders to only show years between selected dates.

       

      What I want to be able to do is have a calculation that only calculates the latest year within a selected range (so if the range was 01/01/2009 to 31/12/2016, it would only show the hires for 2016).

       

      My rationale is that I want to create multiple sheets that I can combine into one dashboard and have a graph showing year on year hires, and a card (that's what it's called in Power BI?) that shows latest years hires, all being controlled by the same parameter slider.

       

      I hope this makes sense!

       

      Kind regards,

       

      Andy