Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

How to calculate weekly average?

I'm trying to calculate Weekly Average of Quantity of an Item ordered by the customer. 

My data has the following columns in the excel file:

Customer    Item#     Quantity       Due date 

I will be adding the customer as a filter. I would like to calculate the weekly average quantity based on the due date. I extracted the week number from the Due date in the power query editor.

 

Can Some one help me with this?

 

Appreciate your help!

1 Reply

  • v-yuta-msft's avatar
    v-yuta-msft
    Community Support

    Hi koganti333,

     

    As a general solution, you can create a measure using DAX like this pattern:

     

    Average Quantity =
    CALCULATE (
        AVERAGE ( Table[Quantity] ),
        ALLEXCEPT ( Table, Table[WeekNum], Table[Customer] )
    )
    

    Regards,

    Jimmy Tao