Forum Discussion
Counting the rows in a category
Hi Anonymous,
You can use the following formula:
Weeks on Quartile = RANKX(FILTER('Table','Table'[id_employee]=EARLIER('Table'[id_employee]) && 'Table'[quartile]=EARLIER('Table'[quartile])),'Table'[id_week],,ASC,DENSE)
Result:
Works for you? Mark this post as a solution if it does!
- Anonymous4 years agoNot applicable
Hi! It works partially, because I need the counter to be reseted everytime a driver changes from quartile, for exaple:
id_week id_employee quartile Weeks on quartile 1 1 q1 1 2 1 q1 2 3 1 q2 1 4 1 q1 1 Thanks!
- Shaurya4 years ago
Memorable Member
Hi Anonymous,
I can see that the numbers in my previous reply match with those in your post. Can you please elaborate this driver change scenario?
- Anonymous4 years agoNot applicable
Sorry, my sample data wasn't taking into consideration every case. Using the code of your reply, if a same id_employee is in quartile q1 then in quartile q2 and then again in quartile q1 I get the following result for the calculated column:
Weeks in quartile
1
1
2
What I should get is:
Weeks in quartile
1
1
1
Because the counter should reset if the weeks in a same quartile aren't consecutive.
Thanks!