Add filter to a calculated measure

Hello
I have this measure
as it is impacting the performance, I would add a filter in order to allow this calculation only for the issues of a certain project.
Can you please help me?
thanks a lot

DateDiffDays(Tail(
  Filter(
    Descendants([Issue].CurrentMember,[Issue].[Issue]), 
    Not IsEmpty([Issue].CurrentMember.Get('Created at'))
    AND
   [Measures].[Issues created] > 0 
  ), 1
).Item(0).Get('Created at'),now())

Hi @scontu

if you want to find the difference (in days) between the last date when latest issue was created and today, try this faster formula:

DateDiffDays(

Tail(
  Filter(
    Descendants([Time].CurrentMember,[Time].[Day]), 
     [Measures].[Issues created] > 0 
  ), 1
).Item(0).startdate,
now())

This formula finds the latest date, your formula found the date for the last issue (sorted by issue key string not by created date)
There can be a difference if you use it for multiple projects in the report.

Martins / eazyBI