Forum Discussion
jeffmorris1989
9 years agoFrequent Visitor
average difference between multiple dates in column
Hello, I have a problem that I am probably overthinking, but what I need is a measure that will allow me to calculate the average difference between dates in a column. For example - if my da...
- 9 years ago
The calculation starts at first in column one by one, and then in the whole table. So I suggest you add a calculated column first.
DaysBetween = DATEDIFF ( 'Table'[date], FIRSTDATE ( FILTER ( ALL ( 'Table'[DATE] ), 'Table'[DATE] > EARLIER ( 'Table'[DATE] ) ) ), DAY )And then you can create a measure and show the result in visual card.
Measure = SUMX ( FILTER ( ALL ( 'Table' ), 'Table'[DaysBetween] > 1 ), 'Table'[DaysBetween] ) / SUMX ( 'Table', IF ( 'Table'[DaysBetween] > 1, 1, 0 ) )Best Regards,
Herbert
Anonymous
8 years agoNot applicable
Hello, the solution does not work when the first date is repeated. Any ideas?
Ashish_Mathur
8 years agoSuper User
Hi,
Share your data and show the expected result.
- Anonymous8 years agoNot applicable
Hi, here is the table. It has access dates (FECHA in spanish) of my clients 1 and 2. The first date is repeated with what gives me the error of the second image. Thanks!!!