Hi,
Can someone help with information or direct me to post or blog re how the replacer function works in M ,
I have basic replace value ;
Table.ReplaceValue( Source, "A", "XX", Replacer.ReplaceValue, {"Item"} )
which can be re written ;
Table.ReplaceValue( Source, "", "", (x, y, z)=> if x = "A" then "XXX" else x , {"Item"} )
but to take a stage further and replace based on another column;
Table.ReplaceValue( Source,
each [Unit] ,
each if [Item] = "A" then [Unit] * 10 else [Unit] , Replacer.ReplaceValue, {"Unit"} )
But I cannot figure how to re write with 'custome replacer' , I have tried various such as ;
=
Table.ReplaceValue( Source,
each [Unit], "", (x,y,z)=> if [Item] = "A" then x * 10 else x , {"Unit"} )
Which I thought item = "A" then z = current valuue * 10 ?
Richard.
Bookmarks