Table.Schema

Table

Returns a table describing the columns (schema) of the input table.

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

Syntax

Table.Schema(table as table) as table

Parameters

NameTypeRequiredDescription
tabletableYesThe table whose schema to inspect.

Return Value

tableA 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
1OrderID0Number.Type
2CustomerName1Text.Type
3Product2Text.Type
4Category3Text.Type
5UnitPrice4Number.Type
6Quantity5Number.Type
7OrderDate6Date.Type
8Region7Text.Type

Compatibility

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