Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Datediff using a specific ID

I'm trying to use the completed date of action "C1001A" to find out the age of the subsiquent actions in days. 
I think the formula I'm using is filtering everything except "C1001A" out though. 
 
Holding stage age  =
VAR startdate = CALCULATE(MAX(hgmcntac[completed_dt]), hgmcntac[action_cd] = "C1001A")
RETURN
CALCULATE(DATEDIFF(startdate,TODAY(), DAY))
 
I want to end up with:  x number of days since completion of action "C1001A"
Thanks in advance.
  • Anonymous Maybe:

    Holding stage age  =
    VAR startdate = MAXX(FILTER('hgmcntac', hgmcntac[action_cd] = "C1001A"), hgmcntac[completed_dt])
    RETURN
     (TODAY() - startdate) * 1.

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Anonymous Maybe:

    Holding stage age  =
    VAR startdate = MAXX(FILTER('hgmcntac', hgmcntac[action_cd] = "C1001A"), hgmcntac[completed_dt])
    RETURN
     (TODAY() - startdate) * 1.