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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Average Velocity for last 3 Sprints

I need to calculate the average velocity over the last 3 sprints and show it for each Area and Team. I'd like to display it on a visual over Sprints (periods of time typically 2-3 weeks).
I have a fact WorkItems table, where changes made to every work item is recorded:

WorkItemIdChangedDateStateIterationIdAreaIDSPDelivered
100001210/10/2022 08:46NewIt2Ar7 
100001210/10/2022 11:54NewIt2Ar7 
100001213/10/2022 08:30ClosedIt2Ar72
100001310/10/2022 08:46NewIt2Ar7 
100001310/10/2022 11:54NewIt2Ar7 
100001313/10/2022 08:31ClosedIt2Ar72
100001410/10/2022 08:46NewIt2Ar7 
100001410/10/2022 11:54NewIt2Ar7 
100001414/10/2022 08:31ClosedIt2Ar72

I have a dim Areas table with Areas:

AreaIdAreaName
Ar1AN a1
Ar10AN b1
Ar100AN c1

I have 'dim Iterations' table with Sprints and their start and end dates:

IterationIdStartDateEndDateSprintNumber
It32505/01/2022 00:0018/01/2022 23:591
It18410/01/2022 00:0030/03/2022 23:592
It30314/02/2022 00:0011/03/2022 23:593
It21818/02/2022 00:0012/04/2022 23:594

And finally there is the 'AreasToTeams' table which shows what teams are responsible for what Areas. A Team can have multiple Areas and an Area can have multiple Teams:

TeamNameAreaId
Team A1Ar189
Team A1Ar217
Team A2Ar31
Team A3Ar90
Team A4Ar90

The Data Model Looks Like this:

data model.jpg

Let's say Team A1 has delivered 10 points in Sprint 1, then 4 points in Sprint 2, then 13 points in Sprint 3. Their Velocity in Sprint 4 would be (10+4+13) / 3 = 9. To check what Sprint has an Item been delivered I compare the IterationId in 'fact Workitems' with 'dim Iterations' SprintNumber.
I tried to merge all the tables into one 'fact WorkItems', but the refreshing will often time out and the visual also won't load.  Besides the method wouldn't work if I wanted to display Velocity for each team.

 

 

 

Velocity = 
VAR b = MAX( 'fact WorkItems'[SprintNumber]) - 1
VAR a =  b - 2
RETURN
 CALCULATE ( SUM('fact WorkItems'[SPDelivered])/3 ,
 FILTER (
 ALLEXCEPT ( 'fact WorkItems','fact WorkItems'[AreaName] ),
 'fact WorkItems'[SprintNumber] >= a
 && 'fact WorkItems'[SprintNumber] <= b
 )
 )

 

 

 

Please help.
Sample files attached are here

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

I updated your sample pbix file(see the attachment), please check if that is what you want. Please update the formula of measure [Velocity] as below:

Velocity = 
VAR _selteam =
    SELECTEDVALUE ( 'AreasToTeams'[TeamName] )
VAR _areas =
    CALCULATETABLE (
        VALUES ( 'AreasToTeams'[AreaId] ),
        FILTER ( 'AreasToTeams', 'AreasToTeams'[TeamName] = _selteam )
    )
VAR _iterids =
    CALCULATETABLE (
        VALUES ( 'fact workitems'[IterationId] ),
        FILTER ( 'fact workitems', 'fact workitems'[AreaId] IN _areas )
    )
VAR _countofsprint =
    CALCULATE (
        DISTINCTCOUNT ( 'dim iterations'[SprintNumber] ),
        FILTER ( 'dim iterations', 'dim iterations'[IterationId] IN _iterids )
    )
VAR _points =
    CALCULATE (
        SUM ( 'fact WorkItems'[SPDelivered] ),
        FILTER ( 'fact workitems', 'fact workitems'[AreaId] IN _areas )
    )
RETURN
    IF ( ISBLANK ( _points ), BLANK (), DIVIDE ( _points, _countofsprint ) )

yingyinr_0-1668158161262.png

Best Regards

Anonymous
Not applicable

Hi, thanks very much for that. This isn't quite what I'm trying to achieve.
I want to have a column visual plotted over SprintNumber (x Axis), where each column shows Velocity for that srpint. Once again Velocity is a sum of all points delivered in each of the last three sprints divided by 3.
From a Team's selection,  this would look like this: Team A has delivered (in all of their areas) 20 points in Sprint 1, 10 in Sprint 2 and 0 in Sprint 3. Their Velocity in Sprint 4 is (20+10+0)/3=10
From an Area Selection: In Area A1 there has been delivered 5 points in Sprint 1, 5 points in Sprint 2 and 2 points in Sprint 3. That Area's Velocity in Sprint 4 is (5+5+2)/3=4
It's complicated, because I want to be able to view this from any perspective (Team and Area) and one Team can have 1 or more Areas. Equally 1 Area can 1 or more Teams.
I've noticed the sample I attached wasn't the best, so I've changed it for a better one I think.

daXtreme
Solution Sage
Solution Sage

You can't attach files. But you can give a link to the file on a shared drive. Don't forget to grant public access.

Anonymous
Not applicable

Attached, thanks for the tip!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.