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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply

Cummulative Average

 

I have a cost table per week of year (page filtered by this year).   I want to set the cummulative average per week.

gerardotrejogcg_0-1617942764961.png

LT 2 - 95.4

LT 3 -  89 ( [95.4+82.6] / 2)

LT 4 -  88.8 ( [95.4+82.6+88.4] / 3)

 

wanted to use an average but no way how to start with this.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@gerardotrejogcg , Try a new column like

 

averageX(filter(allselected(Table), Table[segement]= max(Table[Segment]) && Table[Week] <= max(Table[Week])),Table[Value])

 

in place of this column Table[Value], you can use a measure too

 

I have assume week on column of matrix

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2

@amitchandak Thanks for your reply.   Actually I have another complexity.    My Date table is populated from Actuals Date (Start) and Forecast Date (End) ...  Eg.  Jan 1st, 2015 - Dec 31st, 2021.

 

Since my measure is using Actuals the last date is April 2021 so no issues.  

SCM Price P/U = DIVIDE ( [SCM Sales] , [SCM Units])

gerardotrejogcg_0-1618245908207.png

  But I want to use your code it's populating the 53 weeks of year.   How can I filter by the last "Actual" week of year ?

 

SCM Price P/U Avg =
AVERAGEX (  FILTER (  ALLSELECTED ( 'Date' ),  'Date'[Week of Year] <= MAX ( 'Date'[Week of Year] )  ),
[SCM Price P/U] )
 
amitchandak
Super User
Super User

@gerardotrejogcg , Try a new column like

 

averageX(filter(allselected(Table), Table[segement]= max(Table[Segment]) && Table[Week] <= max(Table[Week])),Table[Value])

 

in place of this column Table[Value], you can use a measure too

 

I have assume week on column of matrix

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.