Derived column data types

The final parameter to the Table.AddColumn() function is optional but should be specified to define the data type of the new column. In the customer history column example, the new column is defined as a text data type. If a whole number column was created, an Int64.Type would be specified, such as the following example:

MyNewColumn = Table.AddColumn(Product, "My Column", each 5, Int64.Type)

If the data type of the column is not defined in the Table.AddColumn() function or later in the query via the Table.TransformColumnTypes() function, the new column will be set as an Any data type, as shown in the following screenshot:

Data Type of Any

Columns of the Any data type will be loaded to the data model as a text data ...

Get Mastering Microsoft Power BI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.