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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
purpletiger
Frequent Visitor

4 Week Average delayed by one week

Hello! I am trying to create a four week rolling average delayed by one week as the current week will be incomplete and skew the results. 

 

I have created a week number within the Date Table. I have tried the following formula which 

 

TechHrs 4Wk Avg = CALCULATE(SUM([Tech Hrs]), DATESBETWEEN('DATE'[Week],
Earlier(related(Date[week]))-5, Earlier(related(Date[week]))-1))/4

which does not recognize the Date[Week] Column. 

 

I am looking for this as a result

image.png

 

With the original data of (truncated)

image.png

 

Thank you in advance. Your help is greatly appreciated! 

Lynne

1 ACCEPTED SOLUTION
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @purpletiger ,

Based on my test, you could refer to below steps:

Sample data:
(Week is a calculated column:

Week = WEEKNUM('Table1'[Date],2)

1.PNG

Create below measure:

Measure 2 = var week = DISTINCTCOUNT(Table1[Week])
return
IF(week=1,BLANK(),CALCULATE(SUM(Table1[Hrs]),FILTER(ALL('Table1'),'Table1'[Tech]=MAX('Table1'[Tech])&&'Table1'[Week]<=4))/4)

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
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

3 REPLIES 3
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @purpletiger ,

Based on my test, you could refer to below steps:

Sample data:
(Week is a calculated column:

Week = WEEKNUM('Table1'[Date],2)

1.PNG

Create below measure:

Measure 2 = var week = DISTINCTCOUNT(Table1[Week])
return
IF(week=1,BLANK(),CALCULATE(SUM(Table1[Hrs]),FILTER(ALL('Table1'),'Table1'[Tech]=MAX('Table1'[Tech])&&'Table1'[Week]<=4))/4)

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you Daniel - I am actually working on the average based upon the "Week Starting ***). What you have written is helpful and will update this once I get it working. 

 

Hi @purpletiger ,

OK, if your problem could be solved, don't forget to mark one reply as answered to close this topic.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.