Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Nb days between 2 dates

Hi everybody, I did not find the issue, sorry il it exists. I got a problem to find the delay between 2 dates with one id. Ex : id         date 1          01/05/2017 2          02/05/2017 3   ...
  • v-huizhn-msft's avatar
    v-huizhn-msft
    9 years ago

    Hi Anonymous,

    I reproduce your scenario and get expected results.

    Please create the calculated coulmn using the formula below step by step.

    Rank = RANKX(FILTER(Test,Test[id]=EARLIER(Test[id])),Test[date],,ASC)
    
    Result = IF(ISBLANK(LOOKUPVALUE(Test[date],Test[id],Test[id],Test[Rank],Test[Rank]-1)),BLANK(),DATEDIFF(LOOKUPVALUE(Test[date],Test[id],Test[id],Test[Rank],Test[Rank]-1),Test[date],DAY))
    
    Time = Test[Result]/Test[tx]


    Desired result
    Best Regards,
    Angelia