Forum Discussion
Anonymous
8 years agoNot applicable
Conditional Index Column Based on Date
Good day to you all I am looking for some assistance in creating an index column called Trading Day No. based on the sorted date column. Index numbers should begin at 1 and all rows with the same...
- 8 years ago
Hi Anonymous
With DAX you can achieve the same with RANKX
Add it as a calculated column
Trading Day No. = RANKX ( TableName, TableName[Date],, ASC, DENSE )
jthomson
8 years agoSolution Sage
Sounds like a job for Power Query - add steps where you:
- group your table by the date column
- sort it if needed
- add an index column
- join this new table back into what you had in your previous step by the date column, your index column should give you the output you wanted
- Zubair_Muhammad8 years agoCommunity Champion
Hi Anonymous
With DAX you can achieve the same with RANKX
Add it as a calculated column
Trading Day No. = RANKX ( TableName, TableName[Date],, ASC, DENSE )
- Anonymous8 years agoNot applicable
Thank you very much, works perfectly
Much appreciated
Herbz