Forum Discussion
Turnover calculation in DAX
- 6 years ago
Hi Anonymous ,
According to your sample tables, would you please refer to the measure below:
Turnover = VAR a = COUNTROWS ( leavers ) VAR b = CALCULATE ( COUNTROWS ( employees ), FILTER ( ALL ( employees ), RELATED ( weeklist[Offset to Current week] ) >= MAX ( weeklist[Offset to Current week] ) - 52 && RELATED ( weeklist[Offset to Current week] ) < MAX ( weeklist[Offset to Current week] ) ) ) / 52 RETURN DIVIDE ( a, b )If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Anonymous , Try with week rank. Is the sample data you provide is best we can use?
amitchandak the sample data was just to give an indication of the layout, obviously to do a rolling 52 weeks for the last 52 weeks trend, 104 weeks history would be required. Shall I upload sample data? What's the best way to do that? A PBIX file?
- amitchandak6 years agoSuper User
Anonymous , after removing sensetive information load it on one drive or dropbox and share the link here or PM me
- v-deddai1-msft6 years agoCommunity Support
Hi Anonymous ,
According to your sample tables, would you please refer to the measure below:
Turnover = VAR a = COUNTROWS ( leavers ) VAR b = CALCULATE ( COUNTROWS ( employees ), FILTER ( ALL ( employees ), RELATED ( weeklist[Offset to Current week] ) >= MAX ( weeklist[Offset to Current week] ) - 52 && RELATED ( weeklist[Offset to Current week] ) < MAX ( weeklist[Offset to Current week] ) ) ) / 52 RETURN DIVIDE ( a, b )If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai