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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Table.AddIndexColumn - type parameter and Dataflow refresh error - Power BI Service

When attempting to pass the optional parameter columnType to the function Table.AddIndexColumn the parameter is accepted in the query editor but on refresh of the Dataflow it will fail with the error:

 "Error: 5 arguments were passed to a function which expects between 2 and 4..."

 

The documentation @ https://docs.microsoft.com/en-us/powerquery-m/table-addindexcolumn clearly lists the parameter but it would appear that it is not supported in the service.

Table.AddIndexColumn(table as table, newColumnName as text, optional initialValue as nullable number, optional increment as nullable number, optional columnType as nullable type) as table

 

Eg.

The following query works in the dataflow Query Editor window:

 
let
  Source = Table.AddIndexColumn(
    Table.FromRecords({
        [CustomerID = 1, Name = "Bob", Phone = "123-4567"],
        [CustomerID = 2, Name = "Jim", Phone = "987-6543"],
        [CustomerID = 3, Name = "Paul", Phone = "543-7890"],
        [CustomerID = 4, Name = "Ringo", Phone = "232-1550"]
    }), 
    "Index"
    10
    5,
    Int64.Type 
),
  #"Transform columns" = Table.TransformColumnTypes(Source, {{"CustomerID"type text}, {"Name"type text}, {"Phone"type text}})
in
  #"Transform columns"
 

And fails on refresh:

 

Run timeDataflow nameDataflow refresh statusEntity nameStart timeEnd timeEntity refresh statusError
Invalid dateBugTestFailedTest22/07/2020 11:1122/07/2020 11:11FailedError: 5 arguments were passed to a function which expects between 2 and 4... RootActivityId = 94cb84e9-ccca-4725-b1af-ac495f8b0cb5.Param1 = 5 arguments were passed to a function which expects between 2 and 4. Request ID: 43bd154e-d194-56c3-ef88-76a2d1b3738e.

 

Could we get some update to the documentation and a resolution to the issue.

 

Thanks

 

 
Status: New
Comments
v-chuncz-msft
Community Support

@QLD_Jay 

 

Just use Table.TransformColumnTypes instead. To get better technical support for this issue, you may directly create a support ticket.

 

alexwhittles
Frequent Visitor

The liklehood is that you're running an older gateway. The July 2020 gateway (3000.51.7) is required to support 5 parameters.

Alex