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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vikrammankar
Frequent Visitor

Unable to use Table.ReplaceValue because there is "%" sign in column name

Hi,

 

I have table with below data

 

CNOTARGET%ACHIEVED%
36100100
29100100

 

I want to reduce the value in column "TARGET%" by 0.50 if the value in column "CNO" is 36.

 

In Query Editor I am using Table.ReplaceValue to change the value in "TARGET%" column based on "CNO" column with below code

 

= Table.ReplaceValue(#"Replaced Value",each [TARGET%],each if [CUSTOMER NO] = 36 then [TARGET%] - 0.50 else [TARGET%],Replacer.ReplaceValue,{"TARGET%"})

 

 

However it is giving me below error.

 

Error for Table_ReplaceValue.png

 

Now if I rename column "TARGET%" to "TARGET", it works perfectly.  

 

If anybody can please advise how to use Table.ReplaceValue without renaming the column name from "TARGET%" to "TARGET".

 

Thanks & Regards,

Vikram.

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @vikrammankar,

 

Please replace [TARGET%] as [#"TARGET%"], the new formular liek below: 

 

= Table.ReplaceValue(#"Replaced Value",each [#"TARGET%"],each if [CNO] = 36 then [#"TARGET%"] - 0.50 else [#"TARGET%"],Replacer.ReplaceValue,{"TARGET%"})

 

q6.PNG

 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-qiuyu-msft
Community Support
Community Support

Hi @vikrammankar,

 

Please replace [TARGET%] as [#"TARGET%"], the new formular liek below: 

 

= Table.ReplaceValue(#"Replaced Value",each [#"TARGET%"],each if [CNO] = 36 then [#"TARGET%"] - 0.50 else [#"TARGET%"],Replacer.ReplaceValue,{"TARGET%"})

 

q6.PNG

 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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