Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Help in calculating averages

Hey guys,

 

Just needed some help with performing calculation on averages. I need to calculate an average for the total and if possible monthly as well. Just wondering how can i actually achieve that, noting my total for each month comes from a measure using counts function.

 

Right now my data looks like this:

Assigned toJuly 2022August 2022 Total
xxx34

7

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

     

    It looks like that [YearMonth] are separate columns in your table.

    You will need to unpivot the table to below format:

    Then you could create a measure like below:

    measure = calculate(average([value]),filter(allexcept(table,[assigened to]),[attribute]<>"total"))

     

    Best Regards,

    Jay

9 Replies

  • Shaurya's avatar
    Shaurya
    Memorable Member

    Hi Anonymous,

     

    I don't think you should use count for averages. Here's a way to calculate average for months, let's say January and February in this case and total average.

     

    January Average = CALCULATE(AVERAGE('Table'[Values]),FILTER('Table','Table'[Month]="Jan"))

     

    February Average = CALCULATE(AVERAGE('Table'[Values]),FILTER('Table','Table'[Month]="Feb"))

     

    Total Average = CALCULATE(AVERAGE('Table'[Values]))

     

    Result:

     

     

    Works for you? Mark this post as a solution if it does!

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hey Shaurya,

      Sorry its because of the dataset Im working on, i don't have a column that is showing the total number for each month hence I have to use count of [case reference number] in order to calculate my total number of cases. Hope that clarifies what I am finding.

       

      Regards,

      Shawn

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        No, it is not.  share your raw data table in a format that i can paste in an MS Excel file.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    It looks like that [YearMonth] are separate columns in your table.

    You will need to unpivot the table to below format:

    Then you could create a measure like below:

    measure = calculate(average([value]),filter(allexcept(table,[assigened to]),[attribute]<>"total"))

     

    Best Regards,

    Jay