cancel
Showing results for
Did you mean:
Regular Visitor

## Days in a row working

Hello,

I have a data set with people and days worked:

Person      date                              What I need

A              01/01/2022                     1

A              02/01/2022                     2

B             02/01/2022                      1
A              03/01/2022                     3
B              04/01/2022                     1

So is like each time is not the next day he should back to 1 so i can keep the record about the max days worked in a row.

I am open to solutions in M or DAX

1 ACCEPTED SOLUTION
Community Support

Please try calculated columns as below:

``Index = RANKX(filter('Table 1','Table 1'[Person]=EARLIER('Table 1'[Person])),'Table 1'[Date],,ASC,Dense) ``
``Group = 'Table 1'[Date]-'Table 1'[Index] ``
``New Index = RANKX(filter('Table 1','Table 1'[Person]=EARLIER('Table 1'[Person])&&'Table 1'[Group]=EARLIER('Table 1'[Group])),'Table 1'[Index],,ASC,Dense) ``

Best Regards,
Community Support Team _ Eason

Community Support

Please try calculated columns as below:

``Index = RANKX(filter('Table 1','Table 1'[Person]=EARLIER('Table 1'[Person])),'Table 1'[Date],,ASC,Dense) ``
``Group = 'Table 1'[Date]-'Table 1'[Index] ``
``New Index = RANKX(filter('Table 1','Table 1'[Person]=EARLIER('Table 1'[Person])&&'Table 1'[Group]=EARLIER('Table 1'[Group])),'Table 1'[Index],,ASC,Dense) ``

Best Regards,
Community Support Team _ Eason

Announcements

#### 2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

#### Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

#### Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

#### Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors