Forum Discussion
Power Query: Referencing dynamic Column Names
I have a table with the below columns + some more columns.. the latter I want to keep and the one in the below code I want to remove. It works perfectly.. only problem is that when I update next time the first column is no longer "jul-17" but "aug-17" and that will give me an error since it can't find the "jul-17". So I need to be able to refer to the column position instead of the name for it to work in future uploads. I can do this with the Table.columnNames function, but I can only get that to work when I refer to 1 column and not multiple columns... so I hope you or somebody in this fine forum can help :-)
Old post I know. But in case someone in the future has the same problem.
It looks like you are dealing with financial data coming from Excel. If that is the case, then select a cell in the Excel data, create a table (CTRL+T), name the table (under the Table Design menu), and then have Power Query consume the table, not the worksheet.