Forum Discussion

yellow43's avatar
yellow43
Icon for Helper I rankHelper I
2 years ago
Solved

Calculate Cumulative Average Overtime

Hi Community,    Need help to calculate cumulative average price per product overtime (since product started to be sold. I can have different dates for different products).    Fact Table Prod...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi yellow43 ,

    Based on my testing, please try the following methods:

    1.Create the simple table.

    2.Create the new measure to calculate cumulative average.

     

    average_over = 
    VAR product_sales = CALCULATE(SUM('Fact Table'[Total sales]), ALLEXCEPT('Fact Table', 'Fact Table'[Product]))
    VAR product_quantity = CALCULATE(SUM('Fact Table'[Quantity]), ALLEXCEPT('Fact Table', 'Fact Table'[Product]))
    RETURN
    DIVIDE(product_sales, product_quantity)

     

    3.Drag the measure into the matrix visual. The result is shown below.

     

    Best Regards,

    Wisdom Wu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.