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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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