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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
thibaultM
New Member

Issue computing evolution of YTD employee turnover

Hello all,

 

I apologize if the question has been asked somewere else but I couldn't find an answer to my issue anywhere in the PBI forum. 

 

I have currently an issue computing in PBI a graph displaying the evolution of the YTD employee turnover per month.
We are using the following formula to compute the YTD turnover: YTD turnover = (YTD nb employee in + YTD nb employee out) / (2* nb employee first month of the year).
In my graph I would like to display:

  • In January: (nb employees in for January + nb employees out for January) /(2* nb employee in January)
  • In February: (nb employees in for January & February + nb employees out for January & February ) / (2* nb employee in January)
  • In March: We extend the logic above to include in & out employees from January to March
  • ... 

Below is a subset of the date I'm using to compute this metric, knowing that 2 in the status field means that an employee is part for that month of the current workforce:

YearMonthEmployee IDStatusAffiliate 
20221812A
20221852A
20221862A
20221892A
20221932A
202211052A
2022113932A
202213484OUTA
202216321INA
2022163212A
20222812A
20222852B
20222862B
20222892B
20222932B
202221052B
202221393OUTB
202226321OUTB
20223812B
20223852B
20223862B
20223892B
20223932B
202231052B
202233735INB

 

The issue I have is I don't know how to compute the denominator of my YTD turnover (i.e. 2*Employee_firstmonth), as I want to reuse for every month in my monthly YTD turnover graph a numbre that is fixed and remains constant in time (that measure however should change if I'm filtering by affiliate). Currently I'm using the following formula that returns 0 for Feb and March when I'm ploting it per month:

Employee_firstmonth:= 
CALCULATE(
DISTINCTCOUNT('HR_In_And_Out'[Employee ID]),
FILTER('HR_in_and_Out','HR_in_and_Out'[HistoryType_Cd]="2"),
FILTER(HR_In_And_Out',HR_in_and_Out'[Month]="1")
)

What is the best approach to compute it? 

 

Also to compute the numerator of the YTD turnover I'm using the TotalYTD(DistinctCount) function on the "IN" and "OUT", is it the correct approach if I want to be able to plot my measure per month? 

 

Many thanks for your help,

 

Thibault 

1 REPLY 1
amitchandak
Super User
Super User

@thibaultM , Nor very clear, But you can try date table and time intellignece

 

CALCULATE(
DISTINCTCOUNT('HR_In_And_Out'[Employee ID]),
FILTER('HR_in_and_Out','HR_in_and_Out'[HistoryType_Cd]="2"),
Datesytd('Date'[Date])
)

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s


Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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