1 Reply Latest reply on Nov 2, 2018 4:08 PM by Patrick A Van Der Hyde

    Trouble with averaging over time

    Eric Bettinger

      Hello everyone---just want to say that I'm so grateful for this community to bounce issues off of---has made a world of difference in working with Tableau!

       

      I'm running into an issue with the attached workbook. I'm looking at data over the last "X" months (usually 12) and trying to calculate a Year-to-Date average. What I'm coming up with is lower than when I'm doing the math manually. Any help is greatly appreciated---I had assistance in building this workbook and to be honest I'm not entirely sure how the calculation for YTD was built and why 'Round' in included and/or if there is a better way to get to my answer.

       

      Thanks in advance for the help!

        • 1. Re: Trouble with averaging over time
          Patrick A Van Der Hyde

          Hello Eric,

           

          Please let us know what you are expecting.  The calculation in use is:

           

          IF ISNULL(AVG([Outcome (copy)])) THEN

              "NA"

          ELSE

              STR (ROUND(AVG([Outcome (copy)])*100,2))+"%"

          END

           

          The Round() function is used here to round to 2 decimal places.  The Avg is per Measure Name but remember that this is not the average per month but the average of all rows of data.  If you want to average per month then a LOD calculation might be better.  Let us know. 

           

          Also - please remember to post the version number of Tableau that is in use when posting a workbook so others are able to open and save in the same version. 

           

          patrick