Forum Discussion

TSlowik's avatar
TSlowik
Regular Visitor
1 year ago
Solved

PowerQuery - load first 10 rows of every excel sheet from multiple files

Hi,   I have a SharePoint with multiple excel files and in every file there are multiple sheets. What I want to do, is to load first 10 rows from every sheet from every excel file at the same time....
  • lbendlin's avatar
    1 year ago

    yes, in addition to enumerating the files you also need enumerate all the sheets in each file.  First create a list of all files and their sheets and then use a custom column to select the top 10 rows from each of the elements in the list. Then expand that custom column.

  • vojtechsima's avatar
    1 year ago

    Hello, TSlowik ,
    here's a complete solution. 

    Just fill the parameters and then in query "Files" change first step to Sharepoint.Files, or keep it and test it for local files.


    Here's link for my file:

    first10RowsForEachSheetEachFile.pbix

     

    quick steps:

    1. create sample file operation
      1. get file
      2. select first 10 rows
      3. do that for each sheet
    2. get all files
    3. call function for all files
    4. expand it