@adsa If you don’t want to selectively replace the names then what I prefer to do is create a List containing both Original and the New name, paste this in Advaned Editor:
let
Source = Table.FromRows (
Json.Document (
Binary.Decompress (
Binary.FromText (
"NY65DsIwEER/ZeXaBTe0IQU06aI0VgrLXgkLO2vFBIm/h4lF84p5s4cxaqu02gDN4oOoURu1QwT0A9nJ0xA8V7OHAVpJeXnxXNb4gBhobeLZlnXK2eRk9v/OER2g5RgpP2TiKk4QQLeU4DR18g5cV6wv0VXkWatnVIHb706t9PKp7gIH3CUxNTnHYCeHG+MX",
BinaryEncoding.Base64
),
Compression.Deflate
)
),
let
_t = ( ( type nullable text ) meta [ Serialized.Text = true ] )
in
type table [ ProductCategoryKey = _t, #"Category Code" = _t, Category = _t ]
),
ChangedType = Table.TransformColumnTypes (
Source,
{
{ "ProductCategoryKey", Int64.Type },
{ "Category Code", Int64.Type },
{ "Category", type text }
}
),
OriginalName = Table.ColumnNames ( ChangedType ),
NewName = { "Product Category Key", "Category Sort", "Product Category" },
Combined = List.Zip ( { OriginalName, NewName } ),
Result = Table.RenameColumns ( ChangedType, Combined )
in
Result
Great – glad that worked for you. Thanks for the DataChant reference – I hadn’t seen that one prior. When it comes to Power Query, the combination of Raviv and Feldmann is about as good as it gets (I’m sure there’s a Chris Webb article we could throw in the mix here too…