Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
PODL
New Member

Passing parameters among nested functions- Record, Fields and tables

Hi,

I'm trying to add a column (Hubrid Value) to a nested table, while using Record.Transformfields on the nesting table.

This is what I've been trying to do:

 

 

X= Table.FromRecords(Table.Transformrows(IDandKvutsa, (r)=>
Record.TransformFields(r, {"CSV Table With ID and Kvutsa", (TableField)=>
Table.AddColumn(TableField,{"Hybrid Value", "try"})

}))) 

 

 

My nested tables are in "CSV Table With ID and Kvutsa" column.

I get the error "2 arguments were passed to a function which expects between 3 and 4".

My logic says I can pass on the field of the record "r" I've just passed, but surely I'm missing something.

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

use PowerQueryFormatter to bring your code into an easier to read format

 

X
  = Table.FromRecords(
    Table.Transformrows(
      IDandKvutsa, 
      (r) =>
        Record.TransformFields(
          r, 
          {
            "CSV Table With ID and Kvutsa", 
            (TableField) => Table.AddColumn(TableField, {"Hybrid Value", "try"})
          }
        )
    )
  )

Then provide some more details on IDandKvutsa , TableField,  and generally what you are trying to accomplish as it is not clear from the code.

 

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

use PowerQueryFormatter to bring your code into an easier to read format

 

X
  = Table.FromRecords(
    Table.Transformrows(
      IDandKvutsa, 
      (r) =>
        Record.TransformFields(
          r, 
          {
            "CSV Table With ID and Kvutsa", 
            (TableField) => Table.AddColumn(TableField, {"Hybrid Value", "try"})
          }
        )
    )
  )

Then provide some more details on IDandKvutsa , TableField,  and generally what you are trying to accomplish as it is not clear from the code.

 

IDandKvutsa- Is a table

TableField- Is just a parameter. It represents the nested table in each row of IDandKvutsa

 

I figured it out, my mistake was the list I passed in the AddColumn function. This is how it should look like:

X
  = Table.FromRecords(
    Table.Transformrows(
      IDandKvutsa, 
      (r) =>
        Record.TransformFields(
          r, 
          {
            "CSV Table With ID and Kvutsa", 
            (TableField) => Table.AddColumn(TableField, "Hybrid Value", "try")
          }
        )
    )
  )

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.