Limit the time period of a cumulative issue sum

Hello,
i would like to limit the following cumulative sum and take into account of period of time between two date limits:face_with_raised_eyebrow: ;

Sum(
{
PreviousPeriods([Time].currentHierarchyMember),
[Time].currentHierarchyMember
},
[Measures].[Count Stories Dev Done]

What kind of advice may you give to me ?:smiling_face_with_three_hearts:

thanks in advance

Hi @MisterRed95,

You could try to use the DateBetween function in combination with CASE WHEN. Your formula could look similar to the one below:

CASE WHEN DateBetween(date, from_date, to_date)
THEN
Sum(
    {
    PreviousPeriods([Time].currentHierarchyMember),
    [Time].currentHierarchyMember
    },
    [Measures].[Count Stories Dev Done])
END

You can read more on the DateBetween function and its use on the documentation page.

Kind regards,
Robert / eazyBI support