Forum Discussion

Trevor_'s avatar
Trevor_
Frequent Visitor
7 years ago
Solved

How to Add a Column with the Number of Days Between Two Rows

  Hi, all. I have a table with the following:     Date | Score| Leader 2018-01-14 | 1234 | Test1 2018-01-22 | 1456 | Test1 2018-01-23 | 2345 | Test1 2018-01-26 | 1234 | Test2   What I'd l...
  • Ashish_Mathur's avatar
    7 years ago

    Hi,

     

    Try this calculated column formula

     

    =CALCULATE(MIN(Data[Date]),FILTER(Data,Data[Date]>EARLIER(Data[Date])))-Data[Date]

     

    Hope this helps.

  • Ashish_Mathur's avatar
    Ashish_Mathur
    7 years ago

    You are welcome.  See if this works

     

    =IF(CALCULATE(MIN(Data[Date]),FILTER(Data,Data[Date]>EARLIER(Data[Date])))=0,BLANK(),CALCULATE(MIN(Data[Date]),FILTER(Data,Data[Date]>EARLIER(Data[Date])))-Data[Date])