Forum Discussion
Dynamic column name from its value
- 9 years ago
Watch this video in which "Source" is the name of the previous step in my query.
Unfortunately, while typing, it jumped from the second line to the first line, but it is the same "Source".
Hi, MarcelBeug. I feel like I am really close to getting this to work, but I keep getting the following error:
Expression.Error: We expected a RenameOperations value.
Details:
List
Here is my code:
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each [_PublicationDate]),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Column22"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Removed Columns",{{"Custom", type date}}),
#"Extracted Year" = Table.TransformColumns(#"Changed Type1",{{"Custom", Date.Year, Int64.Type}}),
#"Renamed Columns" = Table.RenameColumns(#"Extracted Year",{{"Custom", "PublicationYear"}}),
AddedCustom1 = Table.AddColumn(#"Renamed Columns", "Year1Calc", each [PublicationYear] + 1),
#"Renamed Columns1" = Table.RenameColumns(AddedCustom1,{{"Year1Calc", AddedCustom1[Year1Calc]{1}}})
in
#"Renamed Columns1"The first 5 steps give my my column value (the publication year +1). the Renamed columns1 step seems like it should work, but then it throws the error.
Any help would be most appreciated! I am reallys stuck and have been hacking away at this for a while.
Were you able to get the correct answer? I have the exact same issue.
Any help would be appreciated.