Forum Discussion

Zyg_D's avatar
Zyg_D
Continued Contributor
6 years ago
Solved

Comparing to category average

I have the 3 first columns, and I want to get the blue one. The values are obtained by comparing grades to grade averages of each area. How to do it?
  • camargos88's avatar
    6 years ago

    Hi Zyg_D ,

     

    Try this one:

     

    Column =
    VAR _avg = CALCULATE(AVERAGE('Table (2)'[Grade]); FILTER('Table (2)'; 'Table (2)'[Area] = EARLIER('Table (2)'[Area])))
    RETURN IF('Table (2)'[Grade] < _avg; "Below Average";
    IF('Table (2)'[Grade] = _avg; "Average";
    "Above Average")
    )
     
    This column is static, if you need it dynamically you can use this link as reference:
     
     
    Did I answer your question? Mark my post as a solution!
    Ricardo