How do I get the formula to “stop” after the current month? I.e., at the time of writing this, the current month is February 2024, and the above formula generates data for March, April, May, June, and July of 2024, but those months (obviously haven’t happened yet)
Try the your formula with DateAfterPeriodEnd and DateInPeriod functions in the CASE statement and see if it works for you:
Case when
-- show any past periods
DateAfterPeriodEnd(
"Today",
[Time].CurrentHierarchyMember)
OR
-- show current period
DateInPeriod(
"Today",
[Time].CurrentHierarchyMember
)
THEN
Avg(
LastPeriods(6, [Time].CurrentHierarchyMember),
[Measures].[Story Points** resolved]
)
END