Type.AddTableKey

 

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.

Add a key to a table type.

Type.AddTableKey (table as type, columns as list,  isPrimary as logical) as type  

ArgumentDescription
tableThe table type to modify.
columnsColumns that define the key.
isPrimaryLogical stating whether or not it is the primary key.
Type.AddTableKey(tableType, {"A", "B"}, false) equals  add a non-primary key that combines values from columns A and B  

Show: