3 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

How can I automatically update Power Queries with new tables/sheets as they are added to a workbook?

Hi Everyone,

I've finished the project for my boss and now working on my personal project y'all have helped me on using VBA. Trying to change it to Power Query and Pivot Tables now that I learned more about them.

Here's my situation, I want the power queries to automatically update when new sheets/tables are added to the workbook. I did a Google search to ask for help it doesn't seem to be working.

The below is the result from Google:

  1. Format Data: Ensure all sheets have identical column headers and format data ranges as Tables (Insert > Table).
  2. Get Data: Go to Data > Get Data > From File > From Workbook (or From Table/Range for a single workbook).
  3. Combine: In Power Query, filter the sheets to include only the ones needed. Expand the data.
  4. Unpivot: Select the columns that should not change (e.g., ID, Name). Right-click and choose "Unpivot Other Columns". This ensures new columns added later are automatically unpivoted.
  5. Load: Click Close & Load.

The steps I've done:

  1. All data on the sheets are formatted as tables with unique names
  2. Loaded the workbook (current)
  3. Filtered 'Name' to begin with XXX_ (Tables are named XXX_Mon where XXX is a company identified and Mon is the 3 letter month) -- This step results in the two tables I'm expecting
    1. Removed 'Item', 'Kind', and 'Hidden' -- This leaves me with 'Name' and 'Daa'
  4. Expanded the Data column
    1. A dialog pops up asking what I want, so I select Agent, Score 1, Score 2, Score 3, Score 4
    2. After clicking OK, I now have 'Name' & the above columns prefixed with Data.
  5. I selected 'Name' and 'Data.Agent' and right-clicked and picked Unpivoted Other Columns
  6. Renamed 'Attribute' to 'Eval'
  7. Renamed 'Value' to 'Score'
  8. Final Result: Name, Data.Agent, Eval, Score
  9. Click on Close & Load To...
    1. Selected Only Create Connection
    2. Click on Add this data to the Data Model

This is showing all the records (50) as expected. When I add a new sheet named XXX Mar with the table name of XXX_Mar. I refresh all, but March isn't loading in to the Power Query (still showing 50 records).

https://preview.redd.it/qk4yuo9dr3jg1.png?width=209&format=png&auto=webp&s=2843e8e1a8452bc65af006a75766d6f099977575

What am I doing wrong to have the query auto-add the new table?

submitted by /u/Difficult_Cricket319
[link] [comments]

Want to read more?

Check out the full article on the original site

View original article

Tagged with

#Excel alternatives for data analysis
#generative AI for data analysis
#big data management in spreadsheets
#conversational data analysis
#real-time data collaboration
#intelligent data visualization
#no-code spreadsheet solutions
#google sheets
#financial modeling with spreadsheets
#natural language processing for spreadsheets
#rows.com
#Excel compatibility
#Power Query
#Pivot Tables
#automatic update
#table
#unpivot
#VBA
#Get Data
#Close & Load