Dynamic Table Header Changes

happyhungarian

Active Member
Joined
Jul 19, 2011
Messages
255
Office Version
  1. 365
Platform
  1. Windows
Hi, I've been searching for a solution to this and have found several all-most solutions. I was hoping to dynamically update the header columns of a table (let's call this table the Info_Table) in power query using a table I have in the workbook that I have created a connection for (called Date_Table). I've been trying to use the list of list solution converting the Date_Table to a list of list and then Table.RenameColumns function in the Info_Table but I want it to only change the headers for which it finds a match in the Date_Table. The reason for this is the column headers on a few columns in the Info_Table could change month to month but most of the columns stay exactly the same. And it's only the columns that stay the same that I can continually reference that I want Power Query to change. Is this possible?

Thanks!
J
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
It would help to see what you're using at the moment as a query, but can't you just remove the columns that might change from the mapping table? Or don't you know what they are in advance?
 
Upvote 0
That seems to be a difficult solution for a rather easy problem imo.
As I understand this, and I hope I'm right, there are columns that remain the same and other columns are "date" like columns. This sounds suspiciously as pivot table inputs.
The solution I would pursue is to unpivot these columns using the "unpivot other columns" feature. Basically, the list of columns that do not change are the ones to select first.
The attribute column, which you can rename in the code or with an extra step, will contain you date information. Having that in a single column does not require you to have this difficult list of list creation in a dynamic way and it will make report making on the data also much simpler.
 
Upvote 0

Forum statistics

Threads
1,226,452
Messages
6,191,132
Members
453,641
Latest member
enfkkviesm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top