Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
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 date should have the same index number as highlighted in the attached. In Excel I am using the formula "=IF(A7=A6,D6,D6+1)". Please see pic below:
The grey column is what I am trying to create
Thank you for your help
Herbz
Solved! Go to Solution.
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 )
Hi @Anonymous,
Please use the solution @Zubair_Muhammad posted, it works successfully after test.expected result
In addition, please mark the right reply as answer, so more members will get useful information or workaround easily.
Best Regards,
Angelia
My problem is very similar, I need to numbering the records for each day. The numbering for each day starts anew, i.e. from 1. Could you help?
Thanks.
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
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 )
Thank you very much, works perfectly
Much appreciated
Herbz
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 69 | |
| 32 | |
| 27 | |
| 26 |