Run into an unexpected refrhsh failure this morning and was able to isolate is to index creation with the simple script below.
I could refresh the dataflow without any issue. Do you have other data sources in your report?
I've found exactly the same problem when using Table.AddIndexColumn.
Works fine in PBI Desktop, but will not refresh from the service.
The workaround is to remove the 5th parameter (the datatype, Int64.Type) and add that as a subsequent step in Power Query.
Microsoft please look into this as it is definitely a problem with PQ in the service.
No, no other datasources in this particular dataflow. Removing the index creation line resolves the problem and the dataflow runs fine. Can apply the workaround that @alexwhittles just posted. Thanks!
Found the problem that was causing mine to fail; running an older gateway.
The July 2020 gateway (3000.51.7) is required to support 5 parameters. I updated to that and it works ok after that.
^ im on Aug 2020 gateway, 3000.54.8, but still running into this.
5 arguments were passed to a function which expects between 2 and 4
confirming that the workaround provided works: