Forum Discussion
Power Query INDEX Column
I added a column for Index using Power Queries built in Index Column function and I placed it as the last item in steps. When I run the query there are 8,300 rows in my table however, the INDEX column populates numbers 1-6207 and then the rest are blank.
Maybe I am not using the right method for what I am needing to do. I am just needing a column at the end of the query to number the rows.
Further up in the steps before the INDEX Column step takes place, I do have a filter that takes place based on a cell's value that is passed to a table. I wouldn't think that would prevent the numbers from populating all the way down but who knows? Anyone have any ideas on how to make this work or perhaps a better way to go about this?
INDEX is applied to the table returned on previos step (by default). If on previous is filtered table, index will be applied to it. It can't be empty cell here, INDEX applies exactly as many indexes as we have rows in the table.
If you add INDEX before filtering it some indexes dissaper together with filtered rows.
However, I didn't catch how you receive such result. If you query the table with 8300 rows, transform it by filterenig into the table with 6207 rows and load result into the grid as another table, in that resulting table shall be exactly 6207 rows without any blanks.
2 Replies
- SergeiBaklanDiamond Contributor
INDEX is applied to the table returned on previos step (by default). If on previous is filtered table, index will be applied to it. It can't be empty cell here, INDEX applies exactly as many indexes as we have rows in the table.
If you add INDEX before filtering it some indexes dissaper together with filtered rows.
However, I didn't catch how you receive such result. If you query the table with 8300 rows, transform it by filterenig into the table with 6207 rows and load result into the grid as another table, in that resulting table shall be exactly 6207 rows without any blanks.
- heylookitsmeIron Contributor
Your response prompted me to re-check my Table and I found that Rows 6208-8300 were not formatted as part of the Table. So, I resized the table so it would capture those as well.
Unfortunately, I just assumed my Table included all items. Rookie mistake on my part. Thanks for the swift response.