Table.Schema
TableReturns a table describing the columns (schema) of the input table.
Syntax
Table.Schema(table as table) as tableParameters
| Name | Type | Required | Description |
|---|---|---|---|
table | table | Yes | The table whose schema to inspect. |
Return Value
table — A table with one row per column, containing metadata such as name, position, type, and kind.
Remarks
Table.Schema returns a metadata table describing the structure of the input table. Each row represents one column and includes information like Name, Position, TypeName, Kind, IsNullable, and more. This is useful for inspecting or validating a table's structure programmatically.
The schema table itself contains many columns. The most commonly used are Name, Position, TypeName, and Kind.
Examples
Example 1: Inspect column names and types
Table.SelectColumns(Table.Schema(Sales), {"Name", "Position", "TypeName"})Result
Name | Position | TypeName | |
|---|---|---|---|
| 1 | OrderID | 0 | Number.Type |
| 2 | CustomerName | 1 | Text.Type |
| 3 | Product | 2 | Text.Type |
| 4 | Category | 3 | Text.Type |
| 5 | UnitPrice | 4 | Number.Type |
| 6 | Quantity | 5 | Number.Type |
| 7 | OrderDate | 6 | Date.Type |
| 8 | Region | 7 | Text.Type |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks