Locked lesson.
About this lesson
Sometimes you want to build a solution that pulls its data from a different Excel workbook. In this lesson we will show you how.
Exercise files
Download this lesson’s related exercise files. You can download source data files for the course from the resources section of your Lessons page.
Getting data from external Excel files.xlsx19.5 KB Getting data from external Excel files - Completed.xlsx
25.7 KB
Quick reference
Getting Data from External Excel files
An overview of building a query using a different Excel workbook.
When to use
When the data to be used in Power Query is saved in a separate Excel file.
Instructions
Getting started
- Create a new query --> From File --> From Excel Workbook --> browse for the file to import
- Select the objects you wish to connect to and click Edit
Which Excel objects you can/cannot access
- You can connect to Tables, Named Ranges or Worksheets
- You cannot connect to Dynamic Named Ranges
- You can also connect to the root of the Excel file (by selecting the folder) to see all objects
Connecting to worksheets
- Importing data that isn’t already in a table might require additional cleaning and transforming
- As many Excel solutions are built ad-hoc and unstructured, it can be difficult to predict what users may do to the worksheets in future
- To keep only certain columns, it is a good practice to select the ones you need --> right click the column header --> Remove Other Columns
Hints & tips
- To import multiple data sources from the file into the query, check the Select Multiple Items box in the preview window
- Date data types do not need to be set by locale as they are already in Excel’s serial number format
Lesson notes are only available for subscribers.