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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Hansolu
Helper II
Helper II

Add a paired index column

Hi, 

I am struggeling to add a paired index column into a nested table in PQ

 

I know how to add an index in the nested table like 1,2,3,4,5,....

what i do need to add is another column lik 1,1,2,2,3,3,4,4,5,5,6,6,...

So repeat the index number one time and go to the next 

 

Guess not so complicate but somehow I struggle with this.

 

thanks

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Hansolu 

First, add a simple index column starting with zero:

Table.AddIndexColumn(Source, "Index", 0, 1, Int64.Type)


then the second one

Number.IntegerDivide([Index], 2) + 1


Result

Fowmy_0-1753958177420.png

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
Hansolu
Helper II
Helper II

Hi, 

thanks both of you, same solution, works great

Actually I was thinking, must be something easy, I just took the wrong turns in my trials

Thanks for the help

mdaatifraza5556
Super User
Super User

Hi @Hansolu 

Can you please try the below steps to get your requirement ?

1. Create index column from 0 

2. Create custome column using below code

= Number.IntegerDivide([Index], 2) + 1

Screenshot 2025-07-31 165821.png

 

After creating custom col if index col is not required then you can remove it.


If this answers your questions, kindly accept it as a solution and give kudos.

Fowmy
Super User
Super User

@Hansolu 

First, add a simple index column starting with zero:

Table.AddIndexColumn(Source, "Index", 0, 1, Int64.Type)


then the second one

Number.IntegerDivide([Index], 2) + 1


Result

Fowmy_0-1753958177420.png

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.