Hi all, need some syntax help here. I have these 3 lines of M code shown below (they're part of a larger query):
The 1st and 3rd line are basically pointless, I'm only including them because the original data set has a column named "Load Factor%". This data set comes from an external 3rd party and I have no control over their naming conventions. The only line I'm interested in keeping is the 2nd line, which divides the original values by 100. Unfortunately, because of the percent sign in the original column name, I keep getting an "Invalid Identifier" error whenever I try to reference the column "Load Factor%" like this:
The error is specifically related to when I refer to the parameter "each [Load Factor%]". Can someone provide me with the escape character syntax that would allow me to directly reference the column "Load Factor%" without having to rename it twice just so I can work with it? I've been able to get #(0025) (the Unicode ID for %) to work when just dealing with a string, but not when it's in the square brackets. Thanks in advance.
Power Query:
#"Remove % from Load Factor Name" = Table.RenameColumns(#"Merge Periods with Comma",{{"Load Factor%", "Load Factor"}}),
#"Divide Load Factor by 100" = Table.ReplaceValue(#"Remove % from Load Factor Name", each [Load Factor], each [Load Factor]/100, Replacer.ReplaceValue, {"Load Factor"}),
#"Add % back to Load Factor%" = Table.RenameColumns(#"Divide Load Factor by 100",{{"Load Factor", "Load Factor%"}}),
The 1st and 3rd line are basically pointless, I'm only including them because the original data set has a column named "Load Factor%". This data set comes from an external 3rd party and I have no control over their naming conventions. The only line I'm interested in keeping is the 2nd line, which divides the original values by 100. Unfortunately, because of the percent sign in the original column name, I keep getting an "Invalid Identifier" error whenever I try to reference the column "Load Factor%" like this:
Power Query:
#"Divide Load Factor by 100" = Table.ReplaceValue(#"Merge Periods with Comma", each [Load Factor%], each [Load Factor%]/100, Replacer.ReplaceValue, {"Load Factor%"}),
The error is specifically related to when I refer to the parameter "each [Load Factor%]". Can someone provide me with the escape character syntax that would allow me to directly reference the column "Load Factor%" without having to rename it twice just so I can work with it? I've been able to get #(0025) (the Unicode ID for %) to work when just dealing with a string, but not when it's in the square brackets. Thanks in advance.