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! Learn more

Reply
Anonymous
Not applicable

Comparing Average Values Indexed

I'm trying to compare 13 week averages and get the % change. 

 

I have a table with all my values by date. I then have a table with date and 13 week period.

 

I am able to relate date with date and get averages by 13 week period but I cannot figure out how to compare to the previous period. I created an index column in my attempt.

 

The logic I'm thinking is MEASURE = ((AVERAGE(VALUE), INDEX) - (AVERAGE(VALUE), INDEX - 1 )) / (AVERAGE(VALUE), INDEX - 1)

 

I'm not sure if I'm on the right track or how to accomplish this. Thanks in advance!

 

(Acomplishing this with a filter value works but is undesirable)

Capture.PNG

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 

I believe you are having the right logic, I create the demo of Running Average, if you want average to a specific index, just change the filter to  <=13, and <13. 

Measure= 
var currentaverage  = CALCULATE(AVERAGE([Value]),FILTER(ALL('Table'),MAXX(FILTER('Table',EARLIER('Table'[Index])<=[Index]),'Table'[Value])))
var previousaverage = CALCULATE(AVERAGE([Value]),FILTER(ALL('Table'),MAXX(FILTER('Table',EARLIER('Table'[Index])<[Index]),'Table'[Value])))
Return (currentaverage - previousaverage) / previousaverage

running average.JPG

Best,
Paul

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Anonymous 

I believe you are having the right logic, I create the demo of Running Average, if you want average to a specific index, just change the filter to  <=13, and <13. 

Measure= 
var currentaverage  = CALCULATE(AVERAGE([Value]),FILTER(ALL('Table'),MAXX(FILTER('Table',EARLIER('Table'[Index])<=[Index]),'Table'[Value])))
var previousaverage = CALCULATE(AVERAGE([Value]),FILTER(ALL('Table'),MAXX(FILTER('Table',EARLIER('Table'[Index])<[Index]),'Table'[Value])))
Return (currentaverage - previousaverage) / previousaverage

running average.JPG

Best,
Paul

Anonymous
Not applicable

I modified it slightly to :

 

% Change =
var currentaverage  = CALCULATE(AVERAGE([Value]),FILTER(ALL('13W Averages'),MAXX(FILTER('13W Averages',EARLIER('13W Averages'[13W Index])=[13W Index]),'13W Averages'[Value])))
var previousaverage = CALCULATE(AVERAGE([Value]),FILTER(ALL('13W Averages'),MAXX(FILTER('13W Averages',EARLIER('13W Averages'[13W Index])=[13W Index]-1),'13W Averages'[Value])))
Return (currentaverage - previousaverage) / previousaverage
 
I think our table might be set up in reverse but you got me 99.9% of the way there! Thank you very much. This was plaguing me for days!

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.