Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Solved! Go to Solution.
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)
Best Regards,
Community Support Team _ Eason
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)
Best Regards,
Community Support Team _ Eason
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
80 | |
63 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |