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.
Hello BI community 🙂
I would like to now in Power BI the number of people who changed entreprise
Assigned Number | Legal Start Date | Person Hire Date | Person Termination Date | Employer | ID | Transfert |
E75H3F-2 | 14/08/2018 | 12/04/2018 | Entreprise A | 89456 | 1 | |
E75H3F | 14/08/2018 | 02/11/2018 | 10/04/2018 | Entreprise B | 89456 | 0 |
E75H3F | 14/08/2018 | 02/11/2018 | 10/04/2019 | Entreprise B | 89456 | 1 |
AH1J91 | 14/08/2018 | 14/08/2018 | 30/10/2018 | Entreprise A | 89456 | 0 |
AH1J91 | 14/08/2018 | 14/08/2018 | 30/10/2018 | Entreprise A | 89456 | 0 |
So the transfert column is what I what, following those conditions:
The ID is the same
The Employer is different
The Assigned Number is different too
The Termination date of the previous entry is max 5 days before the hire date
The last is a thought one, and that's why i'm requesting your help.
What I have so far is:
Transfert = IF(COUNTROWS(CALCULATETABLE('Data'; FILTER('Data'; 'Data'[ID] = EARLIER('Data'[ID])); FILTER('Data'; 'Data'[Employer] <> EARLIER('Data'[Employer])); FILTER('Data'; DATEDIFF(EARLIER('Data'[Termination Date]); 'Data'[Hire Date); DAY) <= 5)
)) > 0 ; 1; 0)
But that's not working, in fact every record concernig a person who has been transfered is set to 1, like this:
Assigned Number | Legal Start Date | Person Hire Date | Person Termination Date | Employer | ID | Transfert |
E75H3F-2 | 14/08/2018 | 12/04/2018 | Entreprise A | 89456 | 1 | |
E75H3F | 14/08/2018 | 02/11/2018 | 10/04/2018 | Entreprise B | 89456 | 1 |
E75H3F | 14/08/2018 | 02/11/2018 | 10/04/2019 | Entreprise B | 89456 | 1 |
AH1J91 | 14/08/2018 | 14/08/2018 | 30/10/2018 | Entreprise A | 89456 | 1 |
AH1J91 | 14/08/2018 | 14/08/2018 | 30/10/2018 | Entreprise A | 89456 | 1 |
Thanks in advance, have a good day ^^
You may check if the following post helps.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |