Forum Discussion

jnixon's avatar
jnixon
Advocate II
6 years ago
Solved

Transforming multiple columns

Greetings M Gurus,   I am trying to write a standalone function that accepts a table as a parameter and returns that table, but with every value in every date column 90 days later:   Date.AddDays(t...
  • mahoneypat's avatar
    6 years ago

    List.Transform is right.  You can do it as follows:

    1.  Add a step with this M code -  ColumnFunctionList = List.Transform(DateColList, each {_, each Date.AddDays(_,90)})

    2. Do your transform step with - NewTable = Table.TransformColumns(MyTable, ColumnFunctionList)

     

    That was a fun one.  Thanks.

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat