Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

New Column that Returns Averages Based on Values from Two Columns

I'd like to add a column that takes the average of the values, given the values in another column. So in the example I have here, it would return the average value for every DRR (x) every CMV (y) an...
  • MFelix's avatar
    7 years ago

    Hi Anonymous,

     

    You should add the following measure / calculated column to your model.

     

    average =
    CALCULATE ( AVERAGE ( Table1[Value] ); ALLEXCEPT ( Table1; Table1[COMM] ) )

    The result is below as you can see as a measure or as a column it works the same way. Best practice advise to add as a measure and not a column.

     

    Adding the column to a table visual it will sum up the values as if you make a measure it makes the average of the values.

     

    Regards,

    MFelix