Forum Discussion
Error while using Table.TransformColumns
Any one can help why I am getting this error message:
Expression.Error: We cannot apply field access to the type Number.
Details:
Value=1.387
Key=FY2023-CIF
When I use this transformation:
= Table.TransformColumns( #"Replaced Value", { { "FY2023-Jan", each [#"FY2023-CIF"] } } )
I want to replace the values in "FY-2023-Jan" column with those in "FY2023-CIF" column
Hi AhmadBakr
Table.TransformColumns only passes the value in the column being transformed as an argument to the function provided in the 2nd argument. This means that it cannot reference values in columns other than the one being transformed.
However, you can use Table.ReplaceValue like this:
= Table.ReplaceValue(#"Replaced Value", each [#"FY2023-Jan"], (_) as number => [#"FY2023-CIF"], Replacer.ReplaceValue, {"FY2023-Jan"})See here.
Does this work for you?
Regards
2 Replies
- OwenAugerSuper User
Hi AhmadBakr
Table.TransformColumns only passes the value in the column being transformed as an argument to the function provided in the 2nd argument. This means that it cannot reference values in columns other than the one being transformed.
However, you can use Table.ReplaceValue like this:
= Table.ReplaceValue(#"Replaced Value", each [#"FY2023-Jan"], (_) as number => [#"FY2023-CIF"], Replacer.ReplaceValue, {"FY2023-Jan"})See here.
Does this work for you?
Regards