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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors