cancel
Showing results for
Did you mean:
Highlighted
Frequent Visitor

## Calculate Cumulative count and reset every year

Hello all,

I have a Table called 'YTD' with columns like Emp_ID, Last_Work_Day(LWD)

I got the count of Total leavers and Cumulative Leavers by below derivations.

I did like this  :

Total leavers = CALCULATE(COUNTA('YTD'[Emp_ID]),'YTD'[LWD]<>BLANK(), USERELATIONSHIP('YTD'[LWD],'Calendar'[Date]))
and
Cumulative Leavers = CALCULATE(COUNTA('YTD'[Emp_ID]), DATESBETWEEN('Calendar'[Date],MINX(ALL('Calendar'[Date]),'Calendar'[Date]),MAX('Calendar'[Date])),USERELATIONSHIP('YTD'[LWD],'Calendar'[Date]))

I've data on few years, and I'd like to reset my Cumulative Leavers on every January,

I tried few things but couldn't help. Can you please guide on this.

1 ACCEPTED SOLUTION

Accepted Solutions
New Contributor

## Re: Calculate Cumulative count and reset every year

```Cumulative Leavers =
Var Year_ = Selectedvalue('Calendar'[Year])
Return
CALCULATE(COUNTA('YTD'[Emp_ID]), DATESBETWEEN('Calendar'[Date],MINX(ALL('Calendar'[Date]),'Calendar'[Date]),MAX('Calendar'[Date])),USERELATIONSHIP('YTD'[LWD],'Calendar'[Date]); 'Calendar'[Year] = Year_)```
2 REPLIES 2
New Contributor

## Re: Calculate Cumulative count and reset every year

```Cumulative Leavers =
Var Year_ = Selectedvalue('Calendar'[Year])
Return
CALCULATE(COUNTA('YTD'[Emp_ID]), DATESBETWEEN('Calendar'[Date],MINX(ALL('Calendar'[Date]),'Calendar'[Date]),MAX('Calendar'[Date])),USERELATIONSHIP('YTD'[LWD],'Calendar'[Date]); 'Calendar'[Year] = Year_)```
Frequent Visitor

## Re: Calculate Cumulative count and reset every year

Thank you @tex628 so much!!

Announcements

#### Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

#### Community News & Announcements

Get your latest community news and announcements.

#### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 55 members 1,189 guests
Recent signins: