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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

% Staff Turnover Measure

Hi there,

 

I am still fairly new to Power BI. Whilst I am now more familar with how to calculate Monthly Staff Turnover and YTD Staff Turnover. I am not sure how to work out the number of employees at the beginning of the month and end of the month to be able to input these values into the staff turnover formula.

 

I have two tables:

1. Current Staff Data

2. Leaver Staff Data 

 

Both tables are the exact same structure (leaver data is simply a cut and paste of the employee entry in the current staff data) - one represents leavers and one represents currently hired staff. The only difference is the Leavers Table contains an Actual Post End Date column.

 

The data looks like this (with all identifying information removed):

1. Current Staff Data

Employee NoDomainTeamCurrent Post End Date 
11004439SASStrategy, Architecture and Support/Strategy and Architecture/Business Analysis  
2153456PASMProduct and Service Mgmt/Service Operations/Deskside Support  
9402751ENGEngineering/Infrastructure/Datacentres  
10095216PASMProduct and Service Mgmt/Service Operations/Deskside Support01/03/2022 
11182695PASMProduct and Service Mgmt/Service Operations/Support Centre16/07/2022 
10283718ENGEngineering/Platforms and Innovation/CRM29/07/2022 
10990597PASMProduct and Service Mgmt/Service Operations/Support Centre31/08/2022 
10227025ENGEngineering/Infrastructure/Datacentres  
10798077RITResearch IT/Research Lifecycle Programme  

 

2. Leaver Staff Data

Employee NoDomainTeamCurrent Post End DateActual Post End Date
10318971ODITIT Supplier Management01/01/202201/01/2022
10765145ODITProject Management/PMO03/01/202203/01/2022
5189438TIONetworks and Security/Networks16/01/202216/01/2022
10615129ODITMarketing and Comms26/01/202226/01/2022
9248303SIAMService Delivery/Service Delivery Management03/02/202203/02/2022
7473469ODITProject Management/PMO16/03/202216/03/2022
9840817SDATesting31/03/202231/03/2022
10864015SIAMService Operations/Deskside Support31/03/202231/03/2022
10525288SDATesting05/04/202205/04/2022

 

Any advice would be greatly appreciated! Thank you.

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

There seems to be something wrong with the data you gave.

vhenrykmstf_0-1658394274569.png

 

If you want to count the number of employees from the beginning to the end of the month, you can try the following formula.

last_mount =
VAR selectedDate =
    LASTDATE ( 'Date'[Date] )
VAR selectedDateMonthsBefore =
    NEXTDAY ( DATEADD ( selectedDate, -1, MONTH ) )
RETURN
    SUMX (
        'Employees',
        IF (
            [End Date] >= selectedDateMonthsBefore
                && [End Date] <= selectedDate,
            1,
            0
        )
    )

 

related link


If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you! This worked. 

v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

There seems to be something wrong with the data you gave.

vhenrykmstf_0-1658394274569.png

 

If you want to count the number of employees from the beginning to the end of the month, you can try the following formula.

last_mount =
VAR selectedDate =
    LASTDATE ( 'Date'[Date] )
VAR selectedDateMonthsBefore =
    NEXTDAY ( DATEADD ( selectedDate, -1, MONTH ) )
RETURN
    SUMX (
        'Employees',
        IF (
            [End Date] >= selectedDateMonthsBefore
                && [End Date] <= selectedDate,
            1,
            0
        )
    )

 

related link


If the problem is still not resolved, please provide detailed error information and test data. Looking forward to your reply.


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.