Forum Discussion
Annual Headcount Average
- 4 years ago
Hi,
This is one way to do this:
data:Dax:
RT empID average =var maxdate = MAX('Calendar'[Date])var rt =CALCULATE (COUNT('Average of empid'[ID]), --ALL('Average of empid'),'Average of empid'[Date]<=maxdate)var _monthnum = MONTH(MAX('Calendar'[Date]))returnDivide(rt,_monthnum)
End result:I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
Hi,
This is one way to do this:
data:
Dax:
End result:
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
- Dimitris_Kats4 years ago
Helper V
Hi ValtteriN
First i would like to thank you for your reply and your help.
I have an issue regarding the data type...the one calendar column is type text and the other type number :(...I am trying to resolve it.
Thank you very very much again for your help- ValtteriN4 years ago
Community Champion
Hi,
Try changing the data type here:
Or in the Powerquery:Or Finally by using functions e.g. VALUES or CONCANETATE
- Dimitris_Kats4 years ago
Helper V
Thank you ValtteriN ,
I managed to resolve my problem by changing your measure:
var maxdate = MAX('Time'[Calendar Date])
var rt =
CALCULATE (
COUNT(Table[Employee ID]), --
ALL('Time'),'Time'[Calendar Date]<=maxdate && Time [Calendar Date]>=min('Time'[Calendar Date]))
var _monthnum = MONTH(MAX('Time'[Calendar Date]))
return
Divide(rt,_monthnum)
Thank you very much again for your help!