Multiple Worksheets, each with the first tab having a different tab name

akephart

New member
Joined
Oct 12, 2016
Messages
12
Reaction score
0
Points
1
Location
Nanaimo
Excel Version(s)
365
Hi,
I am pulling multiple spreadsheets from a folder. For each spreadsheet I am pulling the first tab. Each spreadsheet has a different tab name which I use as a column in my query. When I use the Power Query from a folder, everything works great until I try to combine them. I cannot find the correct syntax to bring in the first tab.
 
Code:
let
    Source = Excel.Workbook(File.Contents("c:\temp\a.xlsx"), null, true),
    First = Table.SelectRows(Source, each [Kind] = "Sheet"){0}[Data],
in
    First
 
So here is my code below. Below is the code that is in the Transform Sample File.

let Source = Excel.Workbook(#"Sample File Parameter1", null, true),
First = Table.SelectRows(Source, each [Kind] = "Sheet"){0}[Data]

in
First


But my error is

Expression.Error: The field 'Kind' of the record wasn't found.
Details:
Name = <name of tab>
Data = Table
 
Back
Top