Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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?
User | Count |
---|---|
84 | |
80 | |
72 | |
71 | |
55 |
User | Count |
---|---|
108 | |
106 | |
93 | |
85 | |
67 |