Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to calculate avg

Hi,   Can you guide me how to calculate avg as per below data. i want dax to calculate avg from 21 march to 27 march.                                                  ...
  • v-easonf-msft's avatar
    4 years ago

    Hi, Anonymous 

    You need to preprocess the data in  ‘Transfor data’ as below:

    1.use headers as first row

    2.Transpose this new table and rename columns

    After processing the above data, you can calculate the average using the following formula:

     

    Measure = CALCULATE(AVERAGE('Table'[Value]),FILTER('Table','Table'[Date]>=DATE(2022,3,21)&&'Table'[Date]<=DATE(2022,3,27)))

     

    Best Regards,
    Community Support Team _ Eason