1 Reply Latest reply on Dec 7, 2018 2:07 PM by Paul Wachtler

    calculate average if not zero

    joe sparty

      Hello,

       

      I've been looking at couple of discussion threads and feel like I'm close to getting a result but still stuck.  For each course name I want to calculate the average only if a course grade has been recorded.  Should I be using a Window_Avg function or LOD calculation?

       

      Thank you,

      -Joe

      discussion

        • 1. Re: calculate average if not zero
          Paul Wachtler

          Hi Joe,

           

          I think this calculation is what you're looking for.  It takes the average of the non null or 0 grade values for each course.

           

          {FIXED  [Course Name]: sum(if [Course Grade] > 0 then [Course Grade] end)}

          /

          {FIXED  [Course Name]: count(if [Course Grade] > 0 then [Course Grade] end)}

           

          Screen Shot 2018-12-07 at 5.04.39 PM.png

           

          Best,

          Paul