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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Iamadityarajput
Frequent Visitor

Rolling Average on Sprints for total story points covered per sprint

Hi,

I have a table and it contains folowing columns 

Issue KeyProductSprint NameStory PointssprintEnddateIssue Type

I want to calculated the rolling average of total story points completed per sprint for a period of 3 consecutive sprints and sprints are supposed to be arranged in ascending order by their enddate.

 

Sample table

Issue KeyProductSprint NameStory PointssprintEnddateIssue Type
DOW-102DOWDOW102/8/2023sub task
DOW-103DOWDOW152/8/2023task
DOW-101DOWDOW232/15/2023defect
DOW-105DOWDOW252/15/2023task
DOW-106DOWDOW222/15/2023subtask
DOW-1009DOWDOW382/22/2023defect
DOW-3102DOWDOW3132/22/2023epic
DOW-1012DOWDOW202/15/2023epic
MNB-3042MNBMNB12-1902/8/2023sub task
MNB-3104MNBMNB12-1953/8/2023task
MNB-2304MNBMNB19-2533/15/2023defect
MNB-34MNBMNB19-2553/15/2023task
MNB-30MNBMNB19-2523/15/2023subtask
MNB-4MNBMNB19-2583/22/2023defect
MNB-3564MNBMNB25-2133/29/2023epic
MNB-324MNBMNB25-203/29/2023epic
MNB-3224MNBMNB25-203/29/2023sub task
AQ-2AQAQ154/15/2023task
AQ-1283AQAQ134/15/2023defect
AQ-3494AQAQ154/15/2023task
AQ-31256AQAQ124/15/2023subtask
AQ-3212AQAQ10184/25/2023defect
AQ-320AQAQ101134/25/2023epic
AQ-326AQAQ10104/25/2023epic
AQ-322AQAQ235/5/2023epic
AQ-1132AQAQ255/5/2023epic

 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Iamadityarajput ,

 

Here are the steps you can follow:

1. In Power Query -- add Column – Index Column – From 1.

vyangliumsft_0-1707118067687.jpeg

2. Create calculated column.

Rank =
RANKX(
    FILTER(ALL('Sample table'),
    'Sample table'[Sprint Name]=EARLIER('Sample table'[Sprint Name])),[sprintEnddate],,DESC,Dense)
Index_2 =
RANKX(
    FILTER(ALL('Sample table'),
     'Sample table'[Sprint Name]=EARLIER('Sample table'[Sprint Name])&&
    'Sample table'[sprintEnddate]=
MINX(
        FILTER(ALL('Sample table'),
        'Sample table'[Sprint Name]=EARLIER('Sample table'[Sprint Name])),[sprintEnddate])),[Index],,ASC)

3. Create measure.

True =
SUMX(
    FILTER(ALL('Sample table'),
    'Sample table'[Sprint Name]=MAX('Sample table'[Sprint Name])&&
   'Sample table'[Rank]<=4),'Sample table'[Story Points])
True  2 =
var _index=
FILTER(
   ALL('Sample table'),
[Index_2]=1)
var _table=
ADDCOLUMNS(
    _index,"measure",[True])
var _table1=
ADDCOLUMNS(
    _table,"result",
 AVERAGEX(
    FILTER(
        _table,
        [sprintEnddate]<=EARLIER([sprintEnddate])),[measure]))  
return
SUMX(
    FILTER(
        _table1,
        [sprintEnddate]=MAX('Sample table'[sprintEnddate])&&[Sprint Name]=MAX('Sample table'[Sprint Name])),[result])
Flag =
IF(
    [True  2]=BLANK(),0,1)

4. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1707118067688.png

5. Result:

vyangliumsft_2-1707118156069.png

Best Regards,

Liu Yang

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

5 REPLIES 5
v-yangliu-msft
Community Support
Community Support

Hi  @Iamadityarajput ,

 

Here are the steps you can follow:

1. In Power Query -- add Column – Index Column – From 1.

vyangliumsft_0-1707118067687.jpeg

2. Create calculated column.

Rank =
RANKX(
    FILTER(ALL('Sample table'),
    'Sample table'[Sprint Name]=EARLIER('Sample table'[Sprint Name])),[sprintEnddate],,DESC,Dense)
Index_2 =
RANKX(
    FILTER(ALL('Sample table'),
     'Sample table'[Sprint Name]=EARLIER('Sample table'[Sprint Name])&&
    'Sample table'[sprintEnddate]=
MINX(
        FILTER(ALL('Sample table'),
        'Sample table'[Sprint Name]=EARLIER('Sample table'[Sprint Name])),[sprintEnddate])),[Index],,ASC)

3. Create measure.

True =
SUMX(
    FILTER(ALL('Sample table'),
    'Sample table'[Sprint Name]=MAX('Sample table'[Sprint Name])&&
   'Sample table'[Rank]<=4),'Sample table'[Story Points])
True  2 =
var _index=
FILTER(
   ALL('Sample table'),
[Index_2]=1)
var _table=
ADDCOLUMNS(
    _index,"measure",[True])
var _table1=
ADDCOLUMNS(
    _table,"result",
 AVERAGEX(
    FILTER(
        _table,
        [sprintEnddate]<=EARLIER([sprintEnddate])),[measure]))  
return
SUMX(
    FILTER(
        _table1,
        [sprintEnddate]=MAX('Sample table'[sprintEnddate])&&[Sprint Name]=MAX('Sample table'[Sprint Name])),[result])
Flag =
IF(
    [True  2]=BLANK(),0,1)

4. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1707118067688.png

5. Result:

vyangliumsft_2-1707118156069.png

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

lbendlin
Super User
Super User

What would be the expected outcome based on the sample data you provided?

Hi @lbendlin ,

I was looking to plot a line and stacked column chart where on x-axis sprints are arranged in descending order of their completion date and on y-axis we have sum of story points completed during those sprints and a line representing rolling average over the period of 4 sprints(it can be variable).

I am trying to create a measure for that.

Iamadityarajput_0-1707039823753.png

 

where on x-axis sprints are arranged in descending order of their completion date 

I think you mean ascending order?

a line representing rolling average over the period of 4 sprints(it can be variable).

I am still unclear what you mean by that. Please elaborate.

 

see attached for the first part. Note that it requires to add the sort column in Power Query as it would result in a circular dependency if it were done in Power BI.

 

 

 

yes, in ascending order(typo),

 

 rolling( moving ) average i.e., sum of story points completed in previous 4 sprints / no. of sprints(4) period could be variable(may increase or decrease), 

Note that it requires to add the sort column in Power Query as it would result in a circular dependency if it were done in Power BI.

do you mean sorted by sprint?

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.