Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Below is sample table I have, I need two measurement.
First is New joiner, which needs "Current Month Status" = 1, and "Last Month Status"=0, like "Jane Doe".
Second is Leaver, which needs "Current Month Status" = 0, and "Last Month Status"=1 , like "John Smith".
But "Michael Chen" should neither count into New joiner or Leaver, because he is internal promotion.
Employee Name Job Title Status Amount
John Smith | Software Engineer | Last Month Status | 1 |
John Smith | Software Engineer | Current Month Status | 0 |
Jane Doe | Marketing Manager | Last Month Status | 0 |
Jane Doe | Marketing Manager | Current Month Status | 1 |
Michael Chen | Data Analyst 1 | Last Month Status | 1 |
Michael Chen | Data Analyst 1 | Current Month Status | 0 |
Michael Chen | Data Analyst 2 | Last Month Status | 0 |
Michael Chen | Data Analyst 2 | Current Month Status | 1 |
Solved! Go to Solution.
hi @Archie_ZHANG ,
There can be many ways to solve this. You have not covered all scenarios. What if employee is promoted and leaves and joins the company again. Please note the solution may not work properly under unknown scenarios. If you can share all of them, I can cover them.
The logic I have used to identify joiners and leavers is
Take max of Previous month status and Current month Status
PrevMth = 0 and CurrMth = 1 - joiners
PrevMth = 1 and CurrMth = 0 - Leavers
PrevMth = 1 and CurrMth = 1 - Ignore
hi @Archie_ZHANG ,
There can be many ways to solve this. You have not covered all scenarios. What if employee is promoted and leaves and joins the company again. Please note the solution may not work properly under unknown scenarios. If you can share all of them, I can cover them.
The logic I have used to identify joiners and leavers is
Take max of Previous month status and Current month Status
PrevMth = 0 and CurrMth = 1 - joiners
PrevMth = 1 and CurrMth = 0 - Leavers
PrevMth = 1 and CurrMth = 1 - Ignore
@talespin Thanks so much for your help. It works well after slight update.
There is an advanced question, not sure can you help to check. Current "Leaver" just count current month & prior month exit employees, do you have any idea on how to get TTM (tailing 12 months, i.e. Feb-23 to Jan-24) leavers and YTD leavers (Jul-23 to Jan-24, Jul is start month of our company). Thanks.
This is HC table raw data: https://drive.google.com/file/d/1PMpP5xwBp6IqtXnrkc9ODEgplfBnw6Sf/view?usp=sharing
**"Calendar" table is time-series table in my PBI working file, which can support Time function.
//this is "leavers" modified from your solution
Please help understand raw data.
1. For EE_ID = E222446, I see two records for each month with different job title, one with Amount 1 and 0.
2. What is the significance of "column "Scenario".
1. Employee with "0" stands for this guy is not in this role,but recoreded due to he on this role before. "1" stands for the role of the employee right now in-seat. For the EE_ID E222446, can understand FY23 whole year, this employee on "SQ_LEARNING ENGAGEMENT AE 4_SQ56014", but he moves to "SQ_LEARNING AE 4_SQ56014" from Jul-24. I also attach a screenshot of original ERP pulling for your better understanding.
2. Scenario is an indicator to distinguish forecast cycle, Current Fcst is the last forecast case finance team process, Plan is planning case finance team doing at the beginning of fiscal year. For easier work, you can filter out "plan" case.
Sorry, I do not understand the data. I have lot of questions.
What about this E151492 & E237903. Please explain.
@talespin Super thanks to your help. E151492, when planning we assume this employee will in-seat across whole year, so "Scenario - Plan" E151492 all month is 1, but this employee resigned at Nov. So from Dec-24 under "Current Fcst", it shows 0 from Dec. E237903, this employee resigned at the end of FY23 (Jun-23), so others month are 0.
If the raw data is too troublesome to understand, you can refer to our original table, can imagine "TblStat[Check]" become three opinions, like, "Current month", "Last Month", and "Two month ago". Then trying to get the rolling leavers number for each month.
Used two measures,
Leavers - It will return Leavers for all months.
Rolling 12Mths Leavers - For every month it will Sum for last 12 month.
To show only last 12 months data in Table and Column chart, i have also applied filter Calendar[Date] on visual(Screenshot).
The logic I have used to identify joiners and leavers is
Take max of Previous month status and Current month Status
PrevMth = 1 and CurrMth = 0 - Leavers
PrevMth = 1 and CurrMth = 1 - Ignore
Employee NameJob TitleDtCheckStatus
John Smith | Software Engineer | 01 October 2022 | 0 |
John Smith | Software Engineer | 01 November 2022 | 0 |
John Smith | Software Engineer | 01 December 2022 | 0 |
John Smith | Software Engineer | 01 January 2023 | 0 |
John Smith | Software Engineer | 01 February 2023 | 0 |
John Smith | Software Engineer | 01 March 2023 | 0 |
John Smith | Software Engineer | 01 April 2023 | 0 |
John Smith | Software Engineer | 01 May 2023 | 0 |
John Smith | Software Engineer | 01 June 2023 | 0 |
John Smith | Software Engineer | 01 July 2023 | 1 |
John Smith | Software Engineer | 01 August 2023 | 1 |
John Smith | Software Engineer | 01 September 2023 | 1 |
John Smith | Software Engineer | 01 October 2023 | 1 |
John Smith | Software Engineer | 01 November 2023 | 1 |
John Smith | Software Engineer | 01 December 2023 | 1 |
John Smith | Software Engineer | 01 January 2024 | 1 |
John Smith | Software Engineer | 01 February 2024 | 1 |
Jane Doe | Marketing Manager | 01 October 2022 | 1 |
Jane Doe | Marketing Manager | 01 November 2022 | 1 |
Jane Doe | Marketing Manager | 01 December 2022 | 1 |
Jane Doe | Marketing Manager | 01 January 2023 | 1 |
Jane Doe | Marketing Manager | 01 February 2023 | 1 |
Jane Doe | Marketing Manager | 01 March 2023 | 1 |
Jane Doe | Marketing Manager | 01 April 2023 | 1 |
Jane Doe | Marketing Manager | 01 May 2023 | 1 |
Jane Doe | Marketing Manager | 01 June 2023 | 1 |
Jane Doe | Marketing Manager | 01 July 2023 | 1 |
Jane Doe | Marketing Manager | 01 August 2023 | 0 |
Jane Doe | Marketing Manager | 01 September 2023 | 0 |
Jane Doe | Marketing Manager | 01 October 2023 | 0 |
Jane Doe | Marketing Manager | 01 November 2023 | 0 |
Jane Doe | Marketing Manager | 01 December 2023 | 0 |
Jane Doe | Marketing Manager | 01 January 2024 | 0 |
Jane Doe | Marketing Manager | 01 February 2024 | 0 |
Michael Chen | Data Analyst 1 | 01 October 2022 | 1 |
Michael Chen | Data Analyst 1 | 01 November 2022 | 1 |
Michael Chen | Data Analyst 1 | 01 December 2022 | 1 |
Michael Chen | Data Analyst 1 | 01 January 2023 | 1 |
Michael Chen | Data Analyst 1 | 01 February 2023 | 1 |
Michael Chen | Data Analyst 1 | 01 March 2023 | 1 |
Michael Chen | Data Analyst 1 | 01 April 2023 | 1 |
Michael Chen | Data Analyst 1 | 01 May 2023 | 1 |
Michael Chen | Data Analyst 1 | 01 June 2023 | 1 |
Michael Chen | Data Analyst 1 | 01 July 2023 | 1 |
Michael Chen | Data Analyst 1 | 01 August 2023 | 1 |
Michael Chen | Data Analyst 1 | 01 September 2023 | 0 |
Michael Chen | Data Analyst 1 | 01 October 2023 | 0 |
Michael Chen | Data Analyst 1 | 01 November 2023 | 0 |
Michael Chen | Data Analyst 1 | 01 December 2023 | 0 |
Michael Chen | Data Analyst 1 | 01 January 2024 | 0 |
Michael Chen | Data Analyst 1 | 01 February 2024 | 0 |
Michael Chen | Data Analyst 2 | 01 October 2022 | 0 |
Michael Chen | Data Analyst 2 | 01 November 2022 | 0 |
Michael Chen | Data Analyst 2 | 01 December 2022 | 0 |
Michael Chen | Data Analyst 2 | 01 January 2023 | 0 |
Michael Chen | Data Analyst 2 | 01 February 2023 | 0 |
Michael Chen | Data Analyst 2 | 01 March 2023 | 0 |
Michael Chen | Data Analyst 2 | 01 April 2023 | 0 |
Michael Chen | Data Analyst 2 | 01 May 2023 | 0 |
Michael Chen | Data Analyst 2 | 01 June 2023 | 0 |
Michael Chen | Data Analyst 2 | 01 July 2023 | 0 |
Michael Chen | Data Analyst 2 | 01 August 2023 | 0 |
Michael Chen | Data Analyst 2 | 01 September 2023 | 1 |
Michael Chen | Data Analyst 2 | 01 October 2023 | 1 |
Michael Chen | Data Analyst 2 | 01 November 2023 | 1 |
Michael Chen | Data Analyst 2 | 01 December 2023 | 1 |
Michael Chen | Data Analyst 2 | 01 January 2024 | 1 |
Michael Chen | Data Analyst 2 | 01 February 2024 | 1 |
Mark | Marketing Manager | 01 October 2022 | 1 |
Mark | Marketing Manager | 01 November 2022 | 1 |
Mark | Marketing Manager | 01 December 2022 | 1 |
Mark | Marketing Manager | 01 January 2023 | 1 |
Mark | Marketing Manager | 01 February 2023 | 1 |
Mark | Marketing Manager | 01 March 2023 | 1 |
Mark | Marketing Manager | 01 April 2023 | 1 |
Mark | Marketing Manager | 01 May 2023 | 1 |
Mark | Marketing Manager | 01 June 2023 | 1 |
Mark | Marketing Manager | 01 July 2023 | 1 |
Mark | Marketing Manager | 01 August 2023 | 1 |
Mark | Marketing Manager | 01 September 2023 | 1 |
Mark | Marketing Manager | 01 October 2023 | 1 |
Mark | Marketing Manager | 01 November 2023 | 0 |
Mark | Marketing Manager | 01 December 2023 | 0 |
Mark | Marketing Manager | 01 January 2024 | 0 |
Mark | Marketing Manager | 01 February 2024 | 0 |
Rose | Software Engineer | 01 October 2022 | 0 |
Rose | Software Engineer | 01 November 2022 | 0 |
Rose | Software Engineer | 01 December 2022 | 0 |
Rose | Software Engineer | 01 January 2023 | 0 |
Rose | Software Engineer | 01 February 2023 | 0 |
Rose | Software Engineer | 01 March 2023 | 0 |
Rose | Software Engineer | 01 April 2023 | 0 |
Rose | Software Engineer | 01 May 2023 | 0 |
Rose | Software Engineer | 01 June 2023 | 0 |
Rose | Software Engineer | 01 July 2023 | 0 |
Rose | Software Engineer | 01 August 2023 | 0 |
Rose | Software Engineer | 01 September 2023 | 0 |
Rose | Software Engineer | 01 October 2023 | 0 |
Rose | Software Engineer | 01 November 2023 | 0 |
Rose | Software Engineer | 01 December 2023 | 1 |
Rose | Software Engineer | 01 January 2024 | 1 |
Rose | Software Engineer | 01 February 2024 | 1 |
Lilly | Data Analyst 1 | 01 October 2022 | 0 |
Lilly | Data Analyst 1 | 01 November 2022 | 0 |
Lilly | Data Analyst 1 | 01 December 2022 | 0 |
Lilly | Data Analyst 1 | 01 January 2023 | 0 |
Lilly | Data Analyst 1 | 01 February 2023 | 1 |
Lilly | Data Analyst 1 | 01 March 2023 | 1 |
Lilly | Data Analyst 1 | 01 April 2023 | 1 |
Lilly | Data Analyst 1 | 01 May 2023 | 1 |
Lilly | Data Analyst 1 | 01 June 2023 | 1 |
Lilly | Data Analyst 1 | 01 July 2023 | 1 |
Lilly | Data Analyst 1 | 01 August 2023 | 0 |
Lilly | Data Analyst 1 | 01 September 2023 | 0 |
Lilly | Data Analyst 1 | 01 October 2023 | 0 |
Lilly | Data Analyst 1 | 01 November 2023 | 0 |
Lilly | Data Analyst 1 | 01 December 2023 | 0 |
Lilly | Data Analyst 1 | 01 January 2024 | 0 |
Lilly | Data Analyst 1 | 01 February 2024 | 0 |
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
33 | |
16 | |
13 | |
10 | |
8 |
User | Count |
---|---|
59 | |
20 | |
12 | |
11 | |
10 |