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
H_insight
Helper V
Helper V

Add prefix if value is number

Hello,

 

I am trying to add a Prefix to Column1 only when the value in the column is a number.

 

H_insight_0-1658149251839.png

I tried the below code to transform the column (without adding a new column):

 

= Table.TransformColumns(#"Changed Type", {{"Column1", each if Value.Is([Column1], Int64.Type ) then "$" & Text.From(_, "en-GB") else _}})

 

 

But I am getting an error: 

 

H_insight_1-1658149329080.png

 

Any steer is greatly appreciated

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Use this

= Table.ReplaceValue(#"Changed Type",each [Column1], each if Value.Is([Column1],type number) then "$" & Text.From([Column1]) else [Column1],Replacer.ReplaceValue,{"Column1"})

View solution in original post

2 REPLIES 2
Vijay_A_Verma
Super User
Super User

Use this

= Table.ReplaceValue(#"Changed Type",each [Column1], each if Value.Is([Column1],type number) then "$" & Text.From([Column1]) else [Column1],Replacer.ReplaceValue,{"Column1"})

@Vijay_A_Verma  Super thanks! 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors