Forum Discussion

Kumar11109's avatar
Kumar11109
Helper IV
8 years ago
Solved

Days Gap For Each Group

Hi All,    I want to find the gap between dates for each group. Sample data can be found here.    Data   How will be able to do it.    Thank You,   
  • Ashish_Mathur's avatar
    Ashish_Mathur
    8 years ago

    Hi,

     

    This is the calculated column formula i wrote.  You may download my solution file from here.

     

    =if(ISBLANK(CALCULATE(MAX(Data[Session Date]),FILTER(Data,Data[GroupId]=EARLIER(Data[GroupId])&&Data[Session Date]<EARLIER(Data[Session Date])))),BLANK(),Data[Session Date]-CALCULATE(MAX(Data[Session Date]),FILTER(Data,Data[GroupId]=EARLIER(Data[GroupId])&&Data[Session Date]<EARLIER(Data[Session Date]))))

     

    Hope this helps.