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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.