Forum Discussion

jppuam's avatar
jppuam
Icon for Helper V rankHelper V
6 years ago
Solved

Count different days from date on the record before

Hello, i'm trying to count the days between the record date and the previous record (as i show in the example)

For each Numbef, i've a appointment date, and i've to calculate the diference between the record date, and the previous record.

For example, in Numbef = 3, 146 days (on one record) that is the diference between 18 July and 22 Fev.

Can you help me with this ?

 

thanks,

jppuam

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi jppuam ,

     

     

     

     

    Click on Calculated Column

     

    Difference in Days =
    var _a = CALCULATE(MAX('Table'[DataFimServico]),Filter('Table','Table'[NumBeneficiario]=EARLIER('Table'[NumBeneficiario]) && 'Table'[DataFimServico] < EARLIER('Table'[DataFimServico])))

    var _b = DATEDIFF(_a,'Table'[DataFimServico],DAY)
    RETURN
    IF (_b =BLANK(),0,_b)

     

     

    Regards,
    Harsh Nathani

    Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

5 Replies