Forum Discussion
Cumulative Average Months from join date
- 5 years ago
Hi Anonymous ,
Actually I‘m a little confused about your issue...
What does Headcount mean? Is the 4 you described in this "because month diff from Apr2020 of Emp1 and Emp2 is both 4" maybe 3= 2020/4 -2020/1 ?
If you want to cumulative Average Months , you could create measure(diff) about Month interval, then use divide calculate average. the following formula to create a measure :step 1: Add Measure (diff )
diff = VAR _maxdate = CALCULATE ( MAX ( [Report date] ), ALLSELECTED ( 'Date' ) ) RETURN DATEDIFF ( MAX ( 'Date'[Report date] ), _maxdate, MONTH )step 2: Add measure(Average )
Average = DIVIDE(SUMX('Date',[diff]),COUNTROWS('Date'))
The final output is shown below:
Or could you please share more detail information to help us clarify your scenario?
Best Regards,
Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Actually I‘m a little confused about your issue...
What does Headcount mean? Is the 4 you described in this "because month diff from Apr2020 of Emp1 and Emp2 is both 4" maybe 3= 2020/4 -2020/1 ?
If you want to cumulative Average Months , you could create measure(diff) about Month interval, then use divide calculate average. the following formula to create a measure :
step 1: Add Measure (diff )
diff =
VAR _maxdate =
CALCULATE ( MAX ( [Report date] ), ALLSELECTED ( 'Date' ) )
RETURN
DATEDIFF ( MAX ( 'Date'[Report date] ), _maxdate, MONTH )
step 2: Add measure(Average )
Average = DIVIDE(SUMX('Date',[diff]),COUNTROWS('Date'))
The final output is shown below:
Or could you please share more detail information to help us clarify your scenario?
Best Regards,
Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Amazing! this is the one. Sorry to confuse you, but you got it! 🙂
Is there a way to use this solution in a trend visual, like bar chart?