Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Siddiq8686
Helper I
Helper I

Employee Turnover

Hello Everyone,

 

I am attaching a table below showing month wise employee population and separations (employees who left the organization.

 

MonthQTRPopulationLeaversTurnover

JanQTR 12830331 
FebQTR 14475266 
MarchQTR 14428291 
AprilQTR 23150442 
MayQTR 23127308 
JuneQTR 24852310 
JulyQTR 32438316 
AugQTR 32779357 
SeptQTR 34725295 
OctQTR 43527338 
NovQTR 44756464 
DecQTR 44835320 

 

I need to make a DAX measure to calculate the employee turnover as per below formula.

 

For montly turnover:

 

No of Separation for respective month  / employee population of 1st month of respective quarter

 

for exmaple is i need to calculate the turnover for the month of June then i need to divide the separations of june by the employee population of April, as april is the first month of quarter 2. 

 

The same formula will be used if i need to calculate the turnover of employee from jan to June then i will divide the sum of separation from jan to june by the avergae population of Jan plus April.

 

Can any one help me pleaase.

 

 

2 ACCEPTED SOLUTIONS

@Siddiq8686 
The final report looks like this
1.png
Make sure you adjust relations like this
2.png
3.png
Following are the measures' code:

 

 

Employee Left = SUM ( Separation_Data4[FTE] )
Population = 
VAR MonthlyPopulation =
    SUM ( Payroll_Merge_File[FTE] )
VAR QuarterAveragePopulation =
    CALCULATE ( 
        AVERAGE ( Payroll_Merge_File[Quarterly Population] ),
        ALLSELECTED (Calendar_Table ),
        CROSSFILTER ( Calendar_Table[Date], Payroll_Merge_File[Payroll Proces Date], None ),
        USERELATIONSHIP (Calendar_Table[Year Quarter], Payroll_Merge_File[Year Quarter] )
    )
VAR Result = 
    IF (
        HASONEVALUE ( Calendar_Table[Year Month] ),
        MonthlyPopulation ,
        QuarterAveragePopulation 
    )
RETURN
    Result 
Monthly Turnover = 
DIVIDE (
    [Employee Left],
    [Population]
)

 

 

 

View solution in original post

Siddiq8686
Helper I
Helper I

This solution is working fine

View solution in original post

6 REPLIES 6
Siddiq8686
Helper I
Helper I

This solution is working fine

Siddiq8686
Helper I
Helper I

and if i need to calculate the turnover of employee for a particular year then below calculation needs to be done;

 

Total separation of the years / (( employees population of Jan + employees population of April+employees                                                                   population of July+ employees population of Oct)/4)

Hi @Siddiq8686 

Please find sample file with solution here https://www.dropbox.com/t/Ojbaa8cK7U2b6goZ

Your report looks like this
Untitled.png
First you need to have two relationships between the Date table and your table, one at "Year Month" granularity and the other at "Year Quarter" granularity 
Untitled1.png
Then use this code to deactivate the non-required relationship and activate the required one. Also something needed to be done at the grand total level (which is the calculation you need for multiquarter selection)

Montly Turnover =
VAR Leavers =
    SUM ( 'Table'[LeaversTurnover] )
VAR MonthlyPopulation =
    CALCULATE (
        AVERAGE ( 'Table'[Population 1st Month of QTR] ),
        CROSSFILTER ( 'Date'[Year Month], 'Table'[Year Month], NONE ),
        USERELATIONSHIP ( 'Date'[Year Quarter], 'Table'[Year Quarter] )
    )
VAR TotalPoulation =
    SUM ( 'Table'[Population 1st Month of QTR] )
VAR Result =
    IF (
        HASONEVALUE ( 'Date'[Year Month] ),
        DIVIDE ( Leavers, MonthlyPopulation ),
        DIVIDE ( Leavers, TotalPoulation )
    )
RETURN
    Result

Please let me know if I solved your problem. If so kindly mark this reply as accepted solution. Thank you

@Siddiq8686 
The final report looks like this
1.png
Make sure you adjust relations like this
2.png
3.png
Following are the measures' code:

 

 

Employee Left = SUM ( Separation_Data4[FTE] )
Population = 
VAR MonthlyPopulation =
    SUM ( Payroll_Merge_File[FTE] )
VAR QuarterAveragePopulation =
    CALCULATE ( 
        AVERAGE ( Payroll_Merge_File[Quarterly Population] ),
        ALLSELECTED (Calendar_Table ),
        CROSSFILTER ( Calendar_Table[Date], Payroll_Merge_File[Payroll Proces Date], None ),
        USERELATIONSHIP (Calendar_Table[Year Quarter], Payroll_Merge_File[Year Quarter] )
    )
VAR Result = 
    IF (
        HASONEVALUE ( Calendar_Table[Year Month] ),
        MonthlyPopulation ,
        QuarterAveragePopulation 
    )
RETURN
    Result 
Monthly Turnover = 
DIVIDE (
    [Employee Left],
    [Population]
)

 

 

 

Hello Tamerj1,

 

Thanks for the solution. Now the measure is working perfect. Many Thanks once again.

 

Regards,

Muhammad Siddiq

Hello Tamerj1,

 

Thanks for the solution. Now the measure is working perfect. Many Thanks once again.

 

Regards,

Muhammad Siddiq

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors