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
gbarr12345
Post Prodigy
Post Prodigy

Creating an index column - unable to do it in power query

Hi everyone,

 

I'm trying to create an index column but unfortunately I'm getting the following error. I think it's because the data is coming from a Data Warehouse that it won't allow me to edit and create the index column as normal?

 

gbarr12345_0-1715635085293.png

 

Is there a calculated column code I can use instead that will work?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@amitchandak Thanks for your contribution on this thread.

Hi @gbarr12345 ,

Which applied step did you get the below error message? According to the screenshot, it seems that it got error when got the data from the data source... If you fail to get the data, then you definitely can't do the following steps. Please make sure you get the data first. Could you please provide the applied codes in your advanced Editor and explain which step got the error for further troubleshooting? 

vyiruanmsft_1-1715841916321.png

Applied codes in Advanced EditorApplied codes in Advanced Editor

 

In addition, ycan refer the following links to add index column:

In Power Query Editor:

Add an index column - Power Query | Microsoft Learn

vyiruanmsft_2-1715842057511.png

By DAX:

DAX 101: How to Create a Calculated Index Column in Power BI - Monocroft

Index_Column = RANKX(ALL(Table[Column]), Table[Column])
Index_Column = COUNTROWS(FILTER(Table, Table[Column] <= EARLIER (Table[Column])))

Best Regards

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@amitchandak Thanks for your contribution on this thread.

Hi @gbarr12345 ,

Which applied step did you get the below error message? According to the screenshot, it seems that it got error when got the data from the data source... If you fail to get the data, then you definitely can't do the following steps. Please make sure you get the data first. Could you please provide the applied codes in your advanced Editor and explain which step got the error for further troubleshooting? 

vyiruanmsft_1-1715841916321.png

Applied codes in Advanced EditorApplied codes in Advanced Editor

 

In addition, ycan refer the following links to add index column:

In Power Query Editor:

Add an index column - Power Query | Microsoft Learn

vyiruanmsft_2-1715842057511.png

By DAX:

DAX 101: How to Create a Calculated Index Column in Power BI - Monocroft

Index_Column = RANKX(ALL(Table[Column]), Table[Column])
Index_Column = COUNTROWS(FILTER(Table, Table[Column] <= EARLIER (Table[Column])))

Best Regards

amitchandak
Super User
Super User

@gbarr12345 , In import mode, you can create an index column, it will not fold back to the source.

I think because only sample rows got loaded in last step- it just passed. Seem like it is erroring because of some data issue in step one when the index is created in step 2.

Increase the time out by using advance connection options and try

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit,

 

Where exactly would I find those in power bi?

 

I'm looking and can't seem to find them.

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.