July 17, 2018
Hi I am trying to rename the last column I can't do it the normal way because the source files have a varying number of columns but the total is always last.
I get a syntax error asking for a comma to replace the } in red if I replace it I get a Token Literal expected error can't see what I am doing wrong
#"Renamed Columns3" = Table.RenameColumns(#"Renamed Columns2",{List.Last(Table.ColumnNames(#"Renamed Columns2"), "Total"}})
VIP
Trusted Members
December 7, 2016
Hello,
It is always easier if there is a sample file, I will give it a try anyway. I am replying this from my tablet, so can’t double check in Power Query how it should be, just viewing your M code.
Seems you are missing one or two brackets. As trying to show below, you are missing one right round bracket, but you also have a mismatch on the number of square brackets.
#"Renamed Columns3" = Table.RenameColumns(#"Renamed Columns2",{List.Last(Table.ColumnNames(#"Renamed Columns2"), "Total"}})
Br,
Anders
Answers Post
1 Guest(s)