Table.ColumnCount
How many columns a table has.
Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Table.ColumnCount(table as table) as number
| Parameter | Type | Description |
|---|---|---|
table | table | The table to look at. |
Returns
number. The number of columns; 0 for a table without any.
Examples
Three columns
Table.ColumnCount(#table({"Product", "Price", "Units"}, {{"Chair", 50, 4}, {"Desk", 120, 1}, {"Lamp", 30, 6}}))
3