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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
juancosta2911
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 

Thanks in advacnce

           

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @juancosta2911 

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) 

veasonfmsft_0-1655461145001.png

Best Regards,
Community Support Team _ Eason

 

View solution in original post

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi, @juancosta2911 

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) 

veasonfmsft_0-1655461145001.png

Best Regards,
Community Support Team _ Eason

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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