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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
kusanagi
Frequent Visitor

Add index column at table view

There is a function in Power Query  of adding Index Column.

Index Column numbered the rows starting from 1 or 0 without repeating numbers.

I need the same function but in table view.

kusanagi_0-1703741452793.png

 

I add a new table using summarize, so there is no Power Query for this table.

Is there any dax function having same effect?

1 ACCEPTED SOLUTION

@kusanagi 

pls try this

Table 2 = ADDCOLUMNS('Table',"Index",RANKX(all('Table'[Item]),'Table'[Item],,ASC))

11.PNG





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

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ryan_mayu
Super User
Super User

@kusanagi 

maybe you can try to use rankx to create the index column

Table 2 = 
VAR tbl=SUMMARIZE('Table','Table'[id],"amount",sum('Table'[value]))
return ADDCOLUMNS(tbl,"Index",rankx(all('Table'[id]),'Table'[id],,ASC))

11.PNG





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

Proud to be a Super User!




Hi Ryan, 

Thank for your reply.

 

I have tried rankx too.

However, I have plenty item with same amount in my case.

I don't want same number coming up.

Here's the example.

Itemamountrankxwhat I want

a

211
b212
c433
d544
e545

 

pls try this

Screenshot_1.png

@kusanagi 

pls try this

Table 2 = ADDCOLUMNS('Table',"Index",RANKX(all('Table'[Item]),'Table'[Item],,ASC))

11.PNG





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

Proud to be a Super User!




Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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