Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AhmadBakr
Helper II
Helper II

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

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super 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


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
AhmadBakr
Helper II
Helper II

@OwenAuger thank you very much for the info and the workaround.

 

Pardon my late response, I have been extremly overloaded and working late nights. This is the first time I log into the forum since I posted the question.

OwenAuger
Super User
Super 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


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.