cancel
Showing results for
Did you mean:
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
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).

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.
3 REPLIES 3
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).

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

## Re: Days of Service - Calculation

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

Announcements

#### 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!

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?

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

#### Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!