I have the folloing custom function, but the last part [Units] I would like to put as a variable ,
( mytable as table, mycol as text ) =>
let
Custom1 = Table.AddColumn ( mytable , "NEW", (A)=>
List.Last(
Table.SelectRows( mytable , (B)=>
Table.Column (B, mycol ) < Table.Column( A, mycol) ) [Units] ) )
in
Custom1
Just trying to add it 'toList' as text and then adding it directly does not work nor does TableColumn ,
( mytable as table, mycol as text, mylist as text ) =>
let
Custom1 = Table.AddColumn ( mytable , "NEW", (A)=>
List.Last(
Table.SelectRows( mytable , (B)=>
Table.Column (B, mycol ) < Table.Column( A, mycol) ), Table.Column(mytable , mylist) ) )
in
Custom1
Is there a way I can not have this part hardcoded. Attached workbook with several attempts.
Richard.
Bookmarks