Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
yellow43
Helper I
Helper I

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

ProductDate[Total Sales] [Quantity]
A31/1/20221503
A5/5/20221004
A6/5/2022101
B30/1/20241506
B2/2/20241003
C30/5/20231002
C5/7/20231502
D6/6/20223002

 

I would like to have a measure to be applied in a matrix visual that has a page Date Slicer.

Despite date applied in the slicer, it should show always the Cumulative Average Overtime Measure as follows: 

 

Output for measure:  

A - 32.50

B - 27.78

C - 62.50

D - 150

 

Thanks in advance. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @yellow43 ,

Based on my testing, please try the following methods:

1.Create the simple table.

vjiewumsft_0-1712886008877.png

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.

vjiewumsft_1-1712886049194.png

vjiewumsft_2-1712886059842.png

 

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.

View solution in original post

2 REPLIES 2
yellow43
Helper I
Helper I

Thank you @Anonymous 

Anonymous
Not applicable

Hi @yellow43 ,

Based on my testing, please try the following methods:

1.Create the simple table.

vjiewumsft_0-1712886008877.png

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.

vjiewumsft_1-1712886049194.png

vjiewumsft_2-1712886059842.png

 

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.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.