Forum Discussion

jobf's avatar
jobf
Helper II
2 years ago
Solved

Difference between dates on the same line with condition.

Hello. I need to calculate the difference between the dates of different applications:   Field  Application   Date P1   1st 01/01/2024 P2   1st 01/05/2024 P1   2nd 01/20/2024 ...
  • Ashish_Mathur's avatar
    2 years ago

    Hi,

    Write this calculated column formula

    Column = if(ISBLANK(CALCULATE(MAX(Data[Date]),FILTER(Data,Data[Field]=EARLIER(Data[Field])&&Data[Date]<EARLIER(Data[Date])))),BLANK(),1*(Data[Date]-CALCULATE(MAX(Data[Date]),FILTER(Data,Data[Field]=EARLIER(Data[Field])&&Data[Date]<EARLIER(Data[Date])))))

    hope this helps.