Forum Discussion
average difference between multiple dates in column
- 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
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
- Anonymous8 years agoNot applicable
Hello, the solution does not work when the first date is repeated. Any ideas?
- Ashish_Mathur8 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!!!