Reputation: 221
I got simple table https://i.sstatic.net/E5Z4h.png with one invoked function. I do not see error in function https://i.sstatic.net/0b9tP.png or in function view but I cannot add next step because there are some error that is not show.
EDIT now I see that error appear when I have invoke function before and the error is A cyclic reference was encountered during evaluation. https://i.sstatic.net/sZqbH.png
let Source = (OrderID as list )=>
OrderID{1}
in Source
Upvotes: 0
Views: 570
Reputation: 5192
I think I know what's happening for you. I think you are using the GUI to add a column with the Invoke Custom Function button. When you do that, you are asked to select a column (actually the table and the column) that you are going to use for your list:
When you do this, Power Query automatically creates a formula with this table and column information to invoke the function:
= Table.AddColumn(#"Added Index", "test_column", each fn(Table2[OrderID]))
But that table reference is actually wrong for this.
You want to replace that table reference with the name of the previous step. In my case, my previous step is Added Index, or #"Added Index" when entered for coding purposes:
(You can also see the name of the previous step already does exist in the formula, after = Table.AddColumn(, by the way.)
So I would change my formula from = Table.AddColumn(#"Added Index", "test_column", each fn(Table2[OrderID]))
to = Table.AddColumn(#"Added Index", "test_column", each fn(#"Added Index"[OrderID]))
.
Anyhow, once I change the table reference from Table2 to #"Added Index", the function works fine.
Upvotes: 1