Table.Type is a type facet in the Power Query M language. It represents the default type claim for the ‘type table’. It is used primarily for interacting with external systems like Power BI, where tabular type information is beneficial. The base type of ‘type table’ in Power Query is a collection of records and provide additional details (such as indicating structured data in rows and columns format) to external systems or tools for enhanced data analysis and reporting.
Examples
Generally, you will face a facet when transforming column types. You can transform a column into the specified type by using Table.TransformColumnTypes:
Table.TransformColumnTypes( Source, {{ "myColumn", Table.Type }} )
Or when adding a column using Table.AddColumn:
Table.AddColumn( Source, "myColumn", #table( {"Col1"}, { 1 } ), Table.Type" )
To inspect the kind of value you are dealing with, you can make use of the Table.Schema function. Applying it to a table returns a table with information about your columns. The Table.SingleRow function then transforms the result into a record, for easier reading.
let
a = #table( {"Col1"}, { 1 } ),
// Ascribes the default type claim facet for 'type table'
b = Value.ReplaceType( a, Table.Type ),
// Returns a table containing a value with the ascribed "Table.Type"
c = #table(type table [Col1 = Value.Type( b ) ], { b } ),
// Shows the Table information, including typeName and value kind
d = Table.Schema( c ),
// For easier viewing, return table as record
e = Table.SingleRow( d )
in
e
Related facets
Other related facets are:
- Any.Type
- Binary.Type
- Byte.Type
- Character.Type
- Currency.Type
- Date.Type
- DateTime.Type
- DateTimeZone.Type
- Decimal.Type
- Double.Type
- Duration.Type
- Function.Type
- Guid.Type
- Int16.Type
- Int32.Type
- Int64.Type
- Int8.Type
- List.Type
- Logical.Type
- None.Type
- Null.Type
- Number.Type
- Password.Type
- Percentage.Type
- Record.Type
- Single.Type
- Text.Type
- Time.Type
- Type.Type
- Uri.Type
2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy