Forum Discussion

sandman153's avatar
sandman153
Regular Visitor
7 years ago
Solved

Avg Subtotal

Hi    I have a visual with a matrix and am trying to get the subtotals as an average rather than a sum. How would I go about doing this?   Is this feasible? Thanks Sarath
  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi, you can use "average per category" quick measure, to learn about "quick measures" check here.

     

    In the example, with the quick measure i get "average of sales monthly" instead of the "sum of sales":

     

    The code of the "quick measure" is:

     

    SALES average per DATE =
    AVERAGEX(
        KEEPFILTERS(VALUES('Table'[DATE])),
        CALCULATE(SUM('Table'[SALES]))
    )