Reply
Member
Posts: 97
Registered: ‎12-15-2017
Accepted Solution

How can I create a simple index column with dax.

I want to create a simple index column starting with 1 next to the total column. 

I can't do it with query editor because it is a calculated table.

 

Giora


Accepted Solutions
Member
Posts: 97
Registered: ‎12-15-2017

Re: How can I create a simple index column with dax.


All Replies
Super User
Posts: 10,775
Registered: ‎07-11-2015

Re: How can I create a simple index column with dax.

I created a calculation called Sequential once, but this is going to depend on what is in your table, can you share that or an example?

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Sequential/m-p/380231

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


Member
Posts: 97
Registered: ‎12-15-2017

Re: 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

Regular Visitor
Posts: 36
Registered: ‎03-28-2017

Re: How can I create a simple index column with dax.

Highlighted
Member
Posts: 97
Registered: ‎12-15-2017

Re: How can I create a simple index column with dax.

[ Edited ]

To my understanding it is a Rank. I want a simple index 1 up to the last row.

 

I'd like to have this:

ScreenHunter_006.jpg

Regular Visitor
Posts: 36
Registered: ‎03-28-2017

Re: How can I create a simple index column with dax.

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

 

Super User
Posts: 10,775
Registered: ‎07-11-2015

Re: How can I create a simple index column with dax.

Oh, well that's super easy, you just need to add a column like this:

 

Index = RANKX(ALL('Table20'),[NetTotal])

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


Member
Posts: 97
Registered: ‎12-15-2017

Re: How can I create a simple index column with dax.

@Greg_Deckler

Yep it works. Thanks

Super User
Posts: 10,775
Registered: ‎07-11-2015

Re: How can I create a simple index column with dax.

Hooray!


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!