Forum Discussion
How can I create a simple index column with dax.
It is very simple. I have a column TOTAL sorted descending. Next to it I need an index starting with 1.
The table is created with DAX so I can't do it with query editor.
Giora
See if this solution helps:
https://community.powerbi.com/t5/Desktop/Add-calculated-index-column-by-DAX/td-p/72448
- gtamir7 years ago
Post Patron
To my understanding it is a Rank. I want a simple index 1 up to the last row.
I'd like to have this:
- Greg_Deckler7 years ago
Community Champion
Oh, well that's super easy, you just need to add a column like this:
Index = RANKX(ALL('Table20'),[NetTotal])- gtamir7 years ago
Post Patron
Yep it works. Thanks
- Anonymous7 years agoNot applicable
Apart from having an index part of the model or using RANK function (aligning it with the fact your net total is sorted) I am drawing a blank. Greg Deckler may have other suggestions. There is an idea that may be of benefit to you that you may want to upvote
https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/19331770-row-number