Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Apply a function to each Table Record

Hi

 

I have grouped record in a way that for each row I get some columns, and one of this columns is of the type "Table".

I want to transform each table using a function, and then Merge all of this tables in just one.

 

How can I do that?

 

 

  • Anonymous's avatar
    Anonymous
    6 years ago

    Solved!

     

    Table.TransformColumns(#"Grouped Rows", {"AllRows", each FuncionUnaTabla(_) })

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I've found how to apply a function to each row, but adding a New Column.

    I don't want to add a new column, instead I want to Transform the AllRows columns.

    How can I change this code to replace instead of adding a new column?

     #"Added Custom1" = Table.AddColumn(#"Grouped Rows", "Custom", each FuncionUnaTabla([AllRows]))

     

    I've tryied with:

    = Table.TransformColumns(#"Grouped Rows", each FuncionUnaTabla([AllRows]))

    but I get the following error:  "Expression.Error: We cannot convert a value of type Function to type List"

     

    Any idea about how to change this?

    Thanks!

    • Anonymous's avatar
      Anonymous
      Not applicable

      Solved!

       

      Table.TransformColumns(#"Grouped Rows", {"AllRows", each FuncionUnaTabla(_) })