Reputation: 67
I want to get a value from the previous row.
I tried the following code as suggested in this post:
Table.AddColumn(#"Added index", "custom column", each {[Index]-1}[column name])
But it throws this error:
Cannot use field access fot type List
Please help, what am I doing wrong?
Upvotes: 1
Views: 20497
Reputation: 7009
The error comes because {[Index]-1}
without anything before it is a list value, but instead you want to index into a row of a table with this syntax: MyTable{index}
That looks like:
= Table.AddColumn(#"Added index", "custom column", each #"Added index"{[Index]-1}[My Column])
Upvotes: 11