Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

M Language - Custom Functions -> Passing a Table by a string name

This is very specific to writing a Power Query Custom Function.  Keep that in mind when responding because I am not looking for a another way to do it without a Custom Function.   I want to create ...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Here  is the solution...

     

    let

        TargetTable = (TargetTableName as text) as table=>

          let

            TargetTable = Record.Field(#sections[Section1], TargetTableName)

          in

            TargetTable,

          MyTable = TargetTable("ccontl")
    in
        MyTable