Forum Discussion
hackfifi
6 years agoHelper V
Add Index based on 2 x Columns
Hi - Just need some help to create the INDEX column. It should be a sequence number sorted on Period but resets when Project Changes. Happy to use a calculated column or adding it to the Power Query ...
- 6 years ago
Hi hackfifi ,
Would you please try to use
Index = RANKX(filter('Table','Table'[Project]=earlier('Table'[Project])),'Table'[Period],,ASC,Dense)If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
az38
6 years agoCommunity Champion
hi hackfifi
try a RANKX() column
Index =
RANKX(
FILTER(
'Table',
'Table'[Project]=EARLIER('Table'[Project])
),
'Table'[Period],,
ASC
)hackfifi
6 years agoHelper V
Hi az38 - Thanks for respondng. but it did not work. I filtered on 1 Project, But the index column is giving me random values
Index = RANKX(filter('Table','Table'[Project]=earlier('Table'[Project])),'Table'[Period],,ASC)
- az386 years agoCommunity Champion
yes, you need to define tie-break rule for the one date - one project rows
- hackfifi6 years agoHelper V
So the tie break rule is when the project changes, the index resets. So what am i doing wrong? 🙂
- v-deddai1-msft6 years agoCommunity Support
Hi hackfifi ,
Would you please try to use
Index = RANKX(filter('Table','Table'[Project]=earlier('Table'[Project])),'Table'[Period],,ASC,Dense)If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai