Calculate Resolved Count till previous month

I am calculating total resolved issues for last 5 months and plotting a line chart using Sparkline data. I want to avoid current month data. Can anybody suggest what to change in the below code?

SparklineData(
– up to 5 month of the selections till today
Tail(
Filter(
DescendantsSet([Time].CurrentMember,[Time].[Month]),
– only periods till today
DateCompare([Time].CurrentHierarchyMember.StartDate,now()) < 0),
– parameter for tail - last 5 members
5) ,
– Numeric_Expression ----- Change measure here if needed
[Measures].[Throughput]
)

Hi @rakeshprusty

Welcome to the Community! :100:

Please try this formula:

SparklineData(
  LastPeriods(
    6,
    IIf(
      [Time].CurrentHierarchyMember IS [Time].CurrentHierarchy.DefaultMember,
      [Time].[Month].CurrentDateMember.PrevMember,
      Tail(CalculatedChildrenSet([Time].CurrentHierarchyMember)).Item(0)
    )
  ),
  [Measures].[Throughput]
)

Remember to set the Formatting to Sparkline.

​Best regards,
​Nauris