Forum Discussion
rogerdea
Helper IV
7 years agoAverage days between dates and locations
I've seen a few topics on this but nothing specific to what i am trying to achieve. What i am trying to do is, for each location in my data, measure the average number of days between dates for e...
- 7 years ago
rogerdea Give this a try. You will need to change the name of your table in the measure.
Avg Days in Location = AVERAGEX ( VALUES ( 'Table'[Location] ), CALCULATE( DIVIDE ( DATEDIFF ( MIN ( 'Table'[Date] ), MAX ( 'Table'[Date] ), DAY ), COUNTROWS ( 'Table' ) -1 ) ) )
jdbuchanan71
Super User
7 years agorogerdea Give this a try. You will need to change the name of your table in the measure.
Avg Days in Location =
AVERAGEX (
VALUES ( 'Table'[Location] ),
CALCULATE(
DIVIDE (
DATEDIFF ( MIN ( 'Table'[Date] ), MAX ( 'Table'[Date] ), DAY ),
COUNTROWS ( 'Table' ) -1
)
)
)rogerdea
Helper IV
7 years agoThank you its worked perfectly !