Forum Discussion

gvg's avatar
gvg
Post Prodigy
5 years ago
Solved

How to reference table[column] as variables in a function

Hi folks, I have a table with very many columns. I am looking to build a function (fChange) that can be called on any column. It looks like this:   = (myTable as table, myColumn as text) => let ...
  • CNENFRNL's avatar
    5 years ago

    gvg , you may want to try

    = (myTable as table, myColumn as text) =>
    let
        #"Replace Value" = Table.ReplaceValue( myTable, "some text", Table.ToList(Table.SelectColumns(myTable, myColumn)){1} & " ccc", Replacer.ReplaceValue, {myColumn})
    in
        #"Replace Value"