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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
user35131
Helper III
Helper III

is there a way using DAX to create an index for each row starting from a specific number

IDIndex
101100000
501100001
701

100002

801100003
901100004
1001100005
1101100006
1201100007
1301100008

 

My normal code

 

ADDCOLUMNS(ID,"Index" ,RANKX(ID,[ID],,ASC,Dense))
 
gives me
 
IDIndex
1011
5012
701

3

8014
9015
10016
11017
12018
13019

 

I would like to keep the same idea but is there a function like Start on(100000) and the index counts from the specific number.

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @user35131 

Thanks for reaching out to us.

>> My normal code   ADDCOLUMNS(ID,"Index" ,RANKX(ID,[ID],,ASC,Dense))

Actually you are very close to the correct answer.

You can try this DAX expression,

t1 = ADDCOLUMNS('Table',"Index" ,RANKX('Table',[ID],,ASC,Dense),"test",100000+RANKX('Table',[ID],,ASC,Dense))

vxiaotang_0-1659602927231.png

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @user35131 

Thanks for reaching out to us.

>> My normal code   ADDCOLUMNS(ID,"Index" ,RANKX(ID,[ID],,ASC,Dense))

Actually you are very close to the correct answer.

You can try this DAX expression,

t1 = ADDCOLUMNS('Table',"Index" ,RANKX('Table',[ID],,ASC,Dense),"test",100000+RANKX('Table',[ID],,ASC,Dense))

vxiaotang_0-1659602927231.png

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

johncolley
Solution Sage
Solution Sage

Hi @user35131 , 2 options:

DAX: add +99999 at the end of your code

Power Query: Add an Index Column - there is an option to start at custom number:

johncolley_0-1657673304141.png

If this answer solves your problem please mark it as a solution!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.