Table.ReplaceKeys
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.
Returns a new table with new key information set in the keys argument.
Table.ReplaceKeys(table as table, keys as list) as table
| Argument | Description |
|---|---|
| table | Table to modify. |
| keys | A list with two fields: Columns and Primary. Columns is a list of columns that are keys. Primary is a primary key. |
Table.ReplaceKeys(Table.FromRecords({[A={[B=1], [B=2]}, C=1]}), {[Columns = {"C"}, Primary = true]})
Show: