Excel.Workbook

Accessing Data

Returns the contents of an Excel workbook as a navigation table.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Excel.Workbook(workbook as binary, optional useHeaders as any, optional delayTypes as nullable logical) as table

Parameters

NameTypeRequiredDescription
workbookbinaryYesThe binary content of an Excel workbook (.xlsx or .xls).
useHeadersanyNoWhen true, the first row of each sheet is treated as column headers. Can also be null.
delayTypeslogicalNoWhen true, type detection is deferred until data is accessed, which can improve performance.

Return Value

tableA navigation table listing the sheets, tables, and named ranges in the workbook.

Remarks

Excel.Workbook reads the binary content of an Excel file and returns a navigation table with the following columns:

| Column | Type | Description | |---|---|---| | Name | text | The name of the sheet, table, or named range. | | Data | table | The data contained within that item. | | Item | text | The type of item: "Sheet", "Table", or "DefinedName". | | Kind | text | Same as Item (included for compatibility). | | Hidden | logical | Whether the sheet or item is hidden. |

### Common patterns

Load a specific sheet by name:

``powerquery let Source = Excel.Workbook(File.Contents("C:\Data\report.xlsx"), true), SalesSheet = Source{[Item = "Sheet", Name = "Sales"]}[Data] in SalesSheet ``

Load a named table:

``powerquery let Source = Excel.Workbook(File.Contents("C:\Data\report.xlsx"), true), OrdersTable = Source{[Item = "Table", Name = "tblOrders"]}[Data] in OrdersTable ``

### Notes

- Pass true for useHeaders to promote the first row of each sheet to column headers automatically. - Setting delayTypes to true can improve performance for large workbooks by deferring type inference. - The navigation table includes all sheets, named tables, and defined names. Use row filtering ({[Item = "Sheet", Name = "..."]}) to drill into a specific item. - Hidden sheets appear in the result with Hidden = true. Filter them out if needed.

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks