Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hey everyone
I have created a table visual with multiple colums from different table after creating the visual I would like to create a index column in the table visual how to do this ? Any leads here please?
I have tried using the below DAX that didn’t work that gave up same numbers in all rows,
Rankx(allselected(main table),calculate(max(maintable[id])),asc,dense)
So my question is how to generate incremental row values on the visual table
Solved! Go to Solution.
@Harineeeeeeee The index column is not displaying unique values because of the ALLSELECTED function.
You can try using ALL('MainTable') instead of ALLSELECTED('MainTable')
IndexColumn = RANKX(ALL('MainTable'), 'MainTable'[id], , ASC, Dense)Or
Index = COUNTROWS(FILTER(ALL(MainTable), MainTable[id] < EARLIER(MainTable[id]))) + 1
I hope this meets your needs. If so, please consider Accepting it as the solution to help others find it more quickly. OR
If my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!
@Harineeeeeeee Happy to know it works. Kindly @ me with any future needs around Power BI and Fabric.
Please give it a kudos by clicking the Thumbs Up! It goes a long way to helping others find this solution quickly.
@Harineeeeeeee your approach is right.
You can modify the query using the following formulas
IndexColumn = RANKX(ALLSELECTED('MainTable'), 'MainTable'[id], , ASC, Dense)
or
Index = COUNTROWS(FILTER(ALLSELECTED(MainTable), MainTable[id] <= EARLIER(MainTable[id])))
Let me know if this works for you. @ me in replies, or I'll lose your thread!!!
Note:
Thanks for the below, now the values are not unique but it gives me some random number not realy sure on what basis that random number is coming, even though i used maintabl[id] as index column which starts from 0.
Any thoughts on this?
Thanks
@Harineeeeeeee The index column is not displaying unique values because of the ALLSELECTED function.
You can try using ALL('MainTable') instead of ALLSELECTED('MainTable')
IndexColumn = RANKX(ALL('MainTable'), 'MainTable'[id], , ASC, Dense)Or
Index = COUNTROWS(FILTER(ALL(MainTable), MainTable[id] < EARLIER(MainTable[id]))) + 1
I hope this meets your needs. If so, please consider Accepting it as the solution to help others find it more quickly. OR
If my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!
Hello @Harineeeeeeee ,
are you able to show the example and the output that you would want to achieve ? that would help alot
best regards,
Considering yellow table is from table A and orange is from table b , after i create a visual combining table a and table b , i want to create a index number
Can you please suggest any ways?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 46 | |
| 42 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 193 | |
| 123 | |
| 99 | |
| 67 | |
| 49 |