How to create a KPI that measure days since the last update?

Hi, anyone can help me create a KPI that measura days since the last update?

Hello @Matheus_Vinicius_Sil ,

Here’s a custom measure I created to count the number of workdays issues spent in various states:

IIf(
  --<LogicalExpression>
  [Measures].[Issue status] = "Closed",
  -- <Value> if YES
  DateDiffWorkdays([Measures].[Issue created date], [Measures].[Transition to status last date]),
  -- <Value> if NO
  IIf(
  IsEmpty([Measures].[Transition from status last date]),
    DateDiffWorkdays(
      [Measures].[Transition to status first date], 
     Now()
    )
  , 
    DateDiffWorkdays(
      [Measures].[Transition to status first date], 
      [Measures].[Transition from status last date]
    )
  )
)

The result looks like this:
image

Replace “DateDiffWorkdays” with “DateDiffDays” if necessary.

Hope it helps!
VasileS.

1 Like

Hi @Matheus_Vinicius_Sil,

eazyBI stores the last updated date for each issue in the property “Issue updated date”. So you can define a calculated measure returning the difference in days between that date and now with the help of DateDiffDays(). See the calculated measure formula below:

DateDiffDays(
  [Measures].[Issue updated date],
  now()
)

See the eazyBI documentation page for more details on the DateDiffDays() function - DateDiffDays.

Best,
Roberts // support@eazybi.com