Power Query #12: Import Multiple Excel Sheets or Tables From Multiple Excel Files
From excelisfun · · 36 min

The player loads from YouTube only when you click. It uses YouTube's privacy-enhanced mode.
If the video does not play, the owner may have turned off embedding. Watch it on YouTube instead.
Description
Download Zipped folder with files: https://excelisfun.net/files/PowerQuery12Files.zip Free Power Query YouTube class from Mike excelisfun Girvin: https://www.youtube.com/playlist?list=PLrRPvpgDmw0lHaJfr4mjRcOMEYqKKvKBj Buy Mike Girvins Power Query M Code book: https://www.amazon.com/Transformative-Magic-Power-Query-Excel/dp/1615470832/ In this video learn how to use the Excel.Workbook M Code function to import Tables, Sheets and Defined Names from Excel files. Also, learn how to create dynamic folder paths in Excel files to avoid On Premises Folder & File Path DataSource.NotFound errors. Learn how the Excel.Workbook function allows you to filter by Kind Object to import just the tables or sheets that you want. Learn about object name conventions that are the most secure method to ensure that you import only the objects that you want. Finally, learn how to avoid the Table.ExpandTableColumn function and instead use the Table.Combine function by extracting attribute from columns and adding those attributes as columns in Custom Columns, while in the process using the let expression to create variables in Mega M Code Formulas. Topics: 1. (00:00) Introduction 2. (00:27) Description of 4 Examples in Video 3. (02:28) Files and folders to download for this video 4. (03:08) Example 1: Create dynamic folder paths in Excel files to avoid On Premises Folder & File Path DataSource.NotFound errors. Use the worksheet functions CELL and TEXTBEFORE and a Defined Name. Use the M Code Folder.Files function to land a table of files from the folder in order to avoid the Formula.Firewall error. 5. (09:05) Example 2: Reference the dynamic folder path, lookup a single source data Excel file and use the Excel.Workbook function to extract the objects from the Excel file. Learn about the importance of the table that the Excel.Workbook functions returns with the five columns: Name, Data, Item, Kind, and Hidden, including how the Name and Item columns differ. Then use multiple M Code steps to extract the desired Excel Tables, add a Sales Rep column from the attribute column with Table names, and append all desired tables to a single table. 6. (16:34) Example 3: Import multiple Excel files, and filter to get only the correct Excel files from the folder. Then build a Custom Column with the Excel.Workbook function to extract all Excel objects from each of the Excel files and then expand column to append all Excel.Workbook object tables. Then we will transform columns to fix Excel object attribute columns and filter to get just the worksheet data (not Excel Table data) that we need. We will learn about the third and fourth arguments of the Excel.Workbook function, including the second argument to promote headers for worksheet data. We will add data types to the final appended single table from multiple messed up Excel files. 7. (25:05) Example 4: In an Power BI Desktop file we use From Folder and the Excel.Workbook function to import Excel Tables from multiple Excel files. Using the Excel file name and the Excel Table names, we add City and Sales Rep columns to the final appended table. However, in this example we avoid the Table.ExpandTableColumn function and instead use the Table.Combine function by extracting attribute from columns and adding those attributes as columns in Custom Columns, while in the process using the let expression to create variables in two Mega M Code Formulas. With the Custom Columns We condense 11 query steps to just five! 8. (35:49) Summary 9. (36:18) Mike Girvin’s Power Query M Code Book 10. (36:29) Closing
This video has subtitles or audio translations in these 89 languages: Abkhazian, Afrikaans, Akan, Albanian, Armenian, Bangla, Belarusian, Bosnian, Bulgarian, Burmese, Cantonese, Chinese, Croatian, Danish, Dutch, Estonian, Faroese, Fijian, Filipino, Finnish, French, Georgian, German, Hawaiian, Hindi, Hungarian, Icelandic, Indonesian, Irish, Italian, Japanese, Khmer, Korean, Kurdish, Lao, Latvian, Lithuanian, Luxembourgish,…