cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Akshaya Established Member
Established Member

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

Accepted Solutions
Chihiro Established Member
Established Member

Re: Days of Service - Calculation

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

Microsoft v-yulgu-msft
Microsoft

Re: Days of Service - Calculation

Hi @Akshaya,

 

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
Chihiro Established Member
Established Member

Re: Days of Service - Calculation

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

Microsoft v-yulgu-msft
Microsoft

Re: Days of Service - Calculation

Hi @Akshaya,

 

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

Akshaya Established Member
Established Member

Re: Days of Service - Calculation

@v-yulgu-msft@Chihiro

 

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

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors