Forum Discussion

Marit's avatar
Marit
Helper II
6 years ago
Solved

Calculate average within category

Hi!

 

Earlier I asked about how I could calculate an average above several categories in a line plot. I used the DAX syntax:

New measure=CALCULATE(AVERAGE('Table'[Value]), ALL('Table'[Category1]),

ALL('Table'[Category2]), ALL('Table'[Category3]))

 

This worked really fine. However, now I want to calculate an average within category1 and above all other categories. Thus, I want an average for each level in category1. Is this possible?

 

Regards Marit

  • Hi Marit ,

     

    You just need to calculate the average for each category:

     

     

    AVERAGE 1= CALCULATE(AVERAGE('Table'[Value]); ALLSELECTED(Table[Category1])

     

    Just repeat this for each of the category.

     

     

     

2 Replies