Forum Discussion
Rank groups within unique IDs and by date
- Anonymous3 years ago
Hi jimminy ,
Here's my solution.
1.Create an index column in Power Query.
2.Go back to Power BI Desktop and create two calculated columns.
Column = IF( 'Table'[Index]= MINX( FILTER(ALL('Table'),'Table'[ticket_id]=EARLIER('Table'[ticket_id])&&'Table'[Service Team]=EARLIER('Table'[Service Team])),[Index]),1,0)Final Rank = SUMX( FILTER(ALL('Table'), 'Table'[ticket_id]=EARLIER('Table'[ticket_id])&&'Table'[Index]<=EARLIER('Table'[Index])),[Column])Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi jimminy ,
Here's my solution.
1.Create an index column in Power Query.
2.Go back to Power BI Desktop and create two calculated columns.
Column =
IF(
'Table'[Index]=
MINX(
FILTER(ALL('Table'),'Table'[ticket_id]=EARLIER('Table'[ticket_id])&&'Table'[Service Team]=EARLIER('Table'[Service Team])),[Index]),1,0)Final Rank =
SUMX(
FILTER(ALL('Table'),
'Table'[ticket_id]=EARLIER('Table'[ticket_id])&&'Table'[Index]<=EARLIER('Table'[Index])),[Column])
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Thanks for the solution. However I run into an issue when the team repeats e.g. if it returns to team 1 after going to team 2. Do you know how to solve this?