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
Anonymous
Not applicable

Days of Service - Calculation

I have an application that refreshes everyday and shows the data as of previous day. For example, today it will show me the visualizations as of yesterday and so on.

 

I woule like to calculate the total number of people who are leaving / Total number of people hired as the following groups :

 

0-30 days of service

31-60 days of service

61 - 90 days of service.

 

How to calculate this and do the grouping? I have the hire date and termination date of the employee.

 

Thank You!

2 ACCEPTED SOLUTIONS
Chihiro
Solution Sage
Solution Sage

Try the solutions in the link.

https://community.powerbi.com/t5/Desktop/Creating-groups-based-on-numbers/m-p/513856

 

Ther's one using M and the other using DAX.

 

Note that you should have Duration column (either in Query or in model).

View solution in original post

v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

Since there are hire date and termination date columns in table, you can create a calculated column via DATEDIFF to calculate the total days of service for each employee. Then, you can refer to the solutions in above link to group these results.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

3 REPLIES 3
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 

Since there are hire date and termination date columns in table, you can create a calculated column via DATEDIFF to calculate the total days of service for each employee. Then, you can refer to the solutions in above link to group these results.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-yulgu-msft@Chihiro

 

Thank You! I created a DATEDIFF Column and created those variations through the SWITCH Statement

Chihiro
Solution Sage
Solution Sage

Try the solutions in the link.

https://community.powerbi.com/t5/Desktop/Creating-groups-based-on-numbers/m-p/513856

 

Ther's one using M and the other using DAX.

 

Note that you should have Duration column (either in Query or in model).

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.