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
V_20
Frequent Visitor

Group Active Employees based on tenure

Hello Community,

 

I have the below requirement which i am unable to write a measure. Let me try to explain my data. I have a Fact table as shown below

 

Table has employee log and tnure at the time of log and their termination date 

 

I also have a Disconnected Date table. 

 

Employee idLog DateTenure MonthsTermination Date
A03-04-20241 
A04-04-20241 
A07-04-2024107-04-2024
A01-04-20241 
B08-04-20241 
B10-04-20241 
B16-04-20242 
B02-04-2024119-04-2024
C15-04-20243 
C08-04-20243 
C13-04-20243 
C10-04-20242 
C02-04-20241 
C13-04-2024216-04-2024
D13-04-20242 
D14-04-20242 
D09-04-20242 
D11-04-20242 
D08-04-20241 
D13-04-20242 

 

 

Now I have a slicer with the Date table date column as "As of Date"

 

Output as of date 08-04-2024 is below as shown

 

As of 08-04-2024 what is the latest record for each employee and who ever is active (termination date blank or more than as of date selected) and their tenure of months on that log date ( ex: A is not active as per 08-04-2024, B tenure is 1 month as of 08-04-2024) 

Output Required: 

 

Tenure At monthsCount of Employees
12
20
31

Hope i made it clear and expecting if any one could help me with measure in calculating this. 

 

Thanks in advane

1 ACCEPTED SOLUTION

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1713667905176.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @V_20 ,

Did @Ashish_Mathur 's suggestions help with your scenario? if that is the case, you can consider Kudo or accept his suggestions to help others who faced similar requirements.

If that also doesn't help, please share more detailed information to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

Cannot understand the expected result.  How did you arive at 2,0,1?  Which are those employees?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

 

the 2,0,1 are the count of employees as of date with tenure months 1,2,3 respectively. 


A got terminated on 7th so as of 8 he is not active employee. He is not conisdered. 

B has tenure of 1 month as of 8th  

C has trnure of 3 months as of 8th

D has tenure of 1month as of 8th date. 

hence the table shows the result of 2 employees with 1 month tenure. 1 employee with 3 month tenure

 

if 8th date log is not there for a employee, we need to get the max date which is less than as of date to get the latest log of that employee. 

 

hope this explains. Kindly let me know if you need further explanation.  

thanks for your reply. 

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1713667905176.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.