Table.TransformColumnTypes

 

This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.

Transforms the column types from a table using a type.

Table.TransformColumnTypes(table as table, typeTransformations as list, optional culture as nullable text) as table  

ArgumentDescription
tableThe Table to modify.
typeTransformationsThe List of typeTransofrmations to make.
optional cultureA text value corresponding to the culture values supported on your version of Windows, such as "en-US". If the culture is not specified, the current user culture is used. For a list of culture names, see National Language Support (NLS) API Reference.
Table.TransformColumnTypes(  
 Table.FromRecords({  
 [A="1",B=2], [A="5", B=10]}),   
 {"A", type number})  
  
 equals Table.FromRecords({  
 [A=1,B=2], [A=5,B=10]})  

Table.TransformColumnTypes(  
 Table.FromRecords({  
 [A="1",B=2],   
 [A="5", B=10]}),  
 {"X", type number})  
  
 equals Expression.Error  

Table.TransformColumnTypes(  
 Table.FromRecords({  
 [A="1/10/1990",B="29,000"],   
 [A="2/10/1990", B="29.000"]}),   
 {{"A", type date}, {"B", type number}}, "en-US")  
  
 equals Table.FromRecords({  
 [A=#date(1990, 10, 1),B=29000],   
 [A=#date(1990, 10, 2),B=29]})  

Show: