Table.ColumnsOfType is a Power Query M function that returns a list with the names of the columns from the input table that match the specified types. The function returns a list of column names with matching types.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Table.ColumnsOfType(
table as table,
listOfTypes as list,
) as list
Description
Returns a list with the names of the columns from table table
that match the types specified in listOfTypes
.
Examples
Return the names of columns of type Number.Type from the table.
// Output: {"a"}
Table.ColumnsOfType(
Table.FromRecords(
{[a = 1, b = "hello"]},
type table[a = Number.Type, b = Text.Type]
),
{type number}
)
Related functions
Other functions related to Table.ColumnsOfType are:
