Forum Discussion
Nepal101
2 years agoHelper III
Calculating days between dates in same column
Hello Everyone, I have a question regarding how to calculate the column or Measure that gives me days between dates Date ClientName salesperson Days Between Running total days or sum days ...
danextian
2 years agoSuper User
Hi Nepal101 ,
Assuming that the days difference is to be calculated by client name:
Days Diff =
VAR __PREV =
CALCULATE (
MAX ( 'Table'[Date] ),
FILTER (
'Table',
'Table'[Date] < EARLIER ( 'Table'[Date] )
&& 'Table'[ClientName] = EARLIER ( 'Table'[ClientName] )
)
)
RETURN
DATEDIFF ( __PREV, 'Table'[Date], DAY ) + 0
Otherwise, remove this line:
&& 'Table'[ClientName] = EARLIER ( 'Table'[ClientName] )