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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User
Super User

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).


@ 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!:
The Definitive Guide to Power Query (M)

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.


@ 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!:
The Definitive Guide to Power Query (M)

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.