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
Jouni900
Frequent Visitor

How to calculate Average of Running Total with Year and Week conditions

Hi,

 

I am currently following the running total of orders on a weekly level. In addition to this what I would like to see is an average weekly order using that running total. So far I haven't found a way on how to achieve the two objectives below  

 

1) I have order data on two consecutive years but I'd like to include only the current 2023 to the formula

2) If two weeks in a month have passed, I'd like the average weekly order to be calculated only using those two weeks' order data  

 

 

With the help of the "Filters on this visual" I have achieved so far 1) by restricting the Year to 2023 only. 

 
The measure that I have been able to produce is the following:
AVERAGEX( VALUES( 'Weekly Tracker calendar'[Week Start]), [Running Total] +0)
 
Is it possible to achieve both 1) and 2) with some modification of the current function or by creating it some way differently?
 
Thank you for the help!
2 REPLIES 2
Jouni900
Frequent Visitor

Hi, @amitchandak 

 

Thanks for the reply, I am sharing the data and the formula that I used. I did not quite get the result I was looking for. Are you able to say what could cause this?

 

 Avg Weekly = calculate(AVERAGEX( VALUES( 'Weekly Tracker calendar'[Week Start]), [Running Total] +0), datesytd('Weekly Tracker calendar'[Date]) )

 

The formula produced a result of 62,63

 

Week NumberRunning TotalYear
559,962022
6130,92022
7204,592022
8291,762022
9325,812022
529,792023
6136,592023
7225,662023
8289,642023
9304,552023
amitchandak
Super User
Super User

@Jouni900 , Try like

 

calculate(

AVERAGEX( VALUES( 'Weekly Tracker calendar'[Week Start]), [Running Total] +0), datesytd('Weekly Tracker calendar'[Date]) )

 

or

 

calculate(

AVERAGEX( VALUES( 'Weekly Tracker calendar'[Week Start]), [Running Total] +0), filter(all('Weekly Tracker calendar'), [Year] = max('Weekly Tracker calendar'[Year]) ) )

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
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.

Top Solution Authors