March 20, 2014
This may be a simple thing but I'm having difficulty figuring it out. I need to add a column to my workbook query from the raw data. I have the query built the way I want it but need to add another field from the raw data that I didn't initially have. Is there an easy way to do this this? I've spent quite a bit of time building this and don't want to mess it up.
Thanks,
Gary
July 16, 2010
Hi Gary,
If the column is in the raw data then I'm assuming you've deleted it along the way after import, or you didn't expand that particular column in the 'Expanded Table Column step? If so, you can just edit that step and change the filter state so that the column is now included.
Mynda
Power Query
Power Pivot
Xtreme Pivot Tables
Excel for Decision Making
Excel for Finance
Excel Analysis Toolpak
Power BI
Excel
Word
Outlook
Excel Expert
Excel Customer Service
PowerPoint
November 8, 2013
Hi Gary,
You can use a dynamic way to expand the table, this way any new column added in source will automatically show up, without manual editing.
You have to replace the Expand Table Column1 arguments where column names are hard typed with a function that extracts the column names from the previous step:
The expand column formula usually looks like:
= Table.ExpandTableColumn(#"Merged Queries", "Column1", {"Column1", "Column2"}, {"Column1", "Column2"}) (there are 2 lists, with initial column names and the new names, most of the times they are identical)
Replace the column names lists:
= Table.ExpandTableColumn(#"Merged Queries", "Column1", Table.ColumnNames(Table.Combine(#"Removed Other Columns1"[Column1])), Table.ColumnNames(Table.Combine(#"Removed Other Columns1"[Column1])))