This is an approach on how to filter the report for the last 5 closed sprints if you have other dimensions in pages which makes the report context.
You could adjust the code to show more/less than 5 and also switch to show first sprints by changing the ordering conditions.
First, you could create a new calculated measure (only to filter last 5 closed sprints sorted by sprint start dates) in your report using this code:
Case when [Sprint].Currentmember.Level.Name = 'Sprint' Then Case when [Sprint].CurrentMember.Name <> '(no sprint)' Then NonZero( Rank( [Sprint].CurrentMember, Tail( Order(Filter( [Sprint].[Sprint].Members, [Measures].[Issues created] >0 AND [Measures].[Sprint closed?]="Yes" -remove line to include all sprints with startdate ), [Sprint].Currentmember.Get('Start date'), BASC) --this is the property by which sprints are sorted ,5))) --use other value to show more/less than 5 sprints End Else [Measures].[Issues created] End
Note the comment on Line11 where you can extend the set
As you can see this code would sort them using “Sprint start date” property.
New calculated measure should return value only for last 5 sprints for the given report context.
Next, you could filter your report rows (“Sprint” dimension members) using this new calculated measure from above (filter rows where new measure value is > 0) and also order the report by the same column before you remove it
Later, you could remove this measure from the report.
The filter conditions should remain.
Martins / eazyBI support