我正在尝试在Power Query中动态重命名一组列,List1是原始列名,List2是新列名。我认为需要将List1和List2合并为一对列表,但无法确定正确的语法。
非常感谢!
非常感谢!
let
//list of original column names
List1= {"Name1","Name2","Name3","Name4"},
//Create test table
Source = Table.FromRows({{1231,1233,4121,5232},{3546,3426,1246,3464}} , List1),
//list of new column names
List2 = {"NewName 1","NewName 2","NewName 3","NewName 4"},
//Rename columns (in practice, the two lists of names will be dynamic, not hard coded as below)
Result = Table.RenameColumns(Source, {
{"Name1","NewName 1"},
{"Name2","NewName 2"},
{"Name3","NewName 3"},
{"Name4", "NewName 4"}})
in
Result