Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Marlonrb
Frequent Visitor

Custom column Index or Ranking by other column

Hi Team!!!

I have a table with AccountReceived informations and Clients.

 

I need to create a new custom column (like an Index) that define an order according the client column changed.

 

I mean: create like a rank column, but it will only be incremented when the client value change.

 

In the end, What I need is, work with only the TOP20 clients informations. (I already have an ordered select query)

 

tks

8 REPLIES 8
Greg_Deckler
Community Champion
Community Champion

I would create another table with just the customers and put an index column on it. Then you should be able to relate the two tables and use the "Sort by" functionality or just filter your visual/page/report to that ID field <= 20.

 

In Query Editor, go to Add Column and then use the Add Index Column drop down in the General area of the ribbon (1st box).



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi,

 

I am super new to Power BI and looking for the information about how to add an index column on a table created in Power BI.

 

Capture.JPG

 

Could you explain this with a bit more details? Thanks a lot!

 

@Ying_P

In the Query Editor you can create a different type of index column.

index.JPG

Thank you @Marlonrb! The problem is: because the table was created in Power BI (data view), after opening edit queries, I was not able to see it in the "Queries" list, so I couldn't select and edit it. Do you know what I make the table show up?

 

Thanks a lot!

Hi my friend,  

Can I bring to P.BI, my client table even it has half milion of records?

 

or How can I create a RANK measure in my table? I need to rank and show only all my 20 big clients

@Marlonrb,

 

According to your description, you want to create a rank column which only increases when group changes. Right?

 

In this scenario, you can just use RANKX() to dense rank based on the group column, please refer to my sample below:

 

rank = RANKX(Query1,Query1[Table_DAX_sorting[name]]],,ASC,Dense)

Capture.PNG

 

Regards,

Sure, half a million records should not be too much of a problem, I've created datasets with millions of rows in them.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

I used the same select, because we've half milion records in our client table.

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors