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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Benx
Helper I
Helper I

Calculate average velocity from previous 3 sprints

Hello all,

I'm trying to calculate the average velocity from the previous 3 sprints, so I can then calculate the variance of the current sprint velocity against the average velocity from the prior three sprints.

Here's a trimmed down view of the data I'm working with:

Sprint nameComplete dateSprint Velocity
ENRL | FY24 Q2 SP0911/29/202339
ADM | FY24 Q2 SP0911/29/202317
AAAMT | FY24 Q2 SP0911/29/202334
ENRL | FY24 Q2 SP1012/13/202346
ADM | FY24 Q2 SP1012/13/20238
AAAMT | FY24 Q2 SP1012/13/202313
ENRL | FY24 Q2 SP1112/27/202316
ADM | FY24 Q2 SP1112/27/202319
AAAMT | FY24 Q2 SP1112/27/202326
ADM | FY24 Q2 SP121/17/202427
ENRL | FY24 Q2 SP121/17/202413
AAAMT | FY24 Q2 SP121/17/20240


Here's the approach I've tried, but it's not producing the expected result:

Avg Velocity Past 3 Sprints =
CALCULATE(
    AVERAGE('Sprint Predictability Data'[Completed work]),
    FILTER(
        ALL('Sprint Predictability Data'),
        'Sprint Predictability Data'[Complete date] < MAX('Sprint Predictability Data'[Complete date]) &&
        'Sprint Predictability Data'[Complete date] >= MAX('Sprint Predictability Data'[Complete date]) -3
    )
)

Can any of you offer suggestions on how I might write this Dax measure?

Thank you!
1 ACCEPTED SOLUTION

@Benx So like this? PBIX is attached.

Better Rolling Average =
VAR __EndDate = MAX('Table'[DateIndex])
VAR __StartDate = __EndDate - 2
VAR __Table =
SUMMARIZE(
FILTER(ALL('Table'),[DateIndex]>=__StartDate && [DateIndex]<=__EndDate),
'Table'[DateIndex],
"__Value",SUM('Table'[Sprint Velocity])
)
RETURN
AVERAGEX(__Table,[__Value])

 
 
 


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@Benx Try this: Better Rolling Average - Microsoft Fabric Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thank you @Greg_Deckler ! Unfortunately, I'm having trouble making your solution work, as I'm not always dealing with a stadard period for the rolling avg. I want to dynamically capture the Sprint Velocity from the  prior three recorded dates. These may fall over the past 6 weeks, but not always. 

I created a DateIndex to assign a number to each distinct date, thinking this would give me what I needed to calcualte the rolling average, without using time intelligence functions. This also has not worked.
This is an example of what I'm trying to acheive.

Benx_0-1706829786309.png

 

@Benx So like this? PBIX is attached.

Better Rolling Average =
VAR __EndDate = MAX('Table'[DateIndex])
VAR __StartDate = __EndDate - 2
VAR __Table =
SUMMARIZE(
FILTER(ALL('Table'),[DateIndex]>=__StartDate && [DateIndex]<=__EndDate),
'Table'[DateIndex],
"__Value",SUM('Table'[Sprint Velocity])
)
RETURN
AVERAGEX(__Table,[__Value])

 
 
 


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.