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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
6DiegoDiego9
Helper I
Helper I

Trim 1 character from the end of the name of ALL the fields

The name of my fields are all like "Brand1", "Model1", "Color1".
How do I remove that last 1 from ALL the fields, possibly with a single Power Query instruction?

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Insert this statement

= Table.TransformColumnNames(Source,(x)=>Text.TrimEnd(x,"1"))

See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUUoC4mQgTgHiVCBOU4qNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Brand2 = _t, Brand1 = _t, Model1 = _t, Color1 = _t, Test2 = _t, Test1 = _t]),
    Custom1 = Table.TransformColumnNames(Source,(x)=>Text.TrimEnd(x,"1"))
in
    Custom1

View solution in original post

1 REPLY 1
Vijay_A_Verma
Super User
Super User

Insert this statement

= Table.TransformColumnNames(Source,(x)=>Text.TrimEnd(x,"1"))

See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUUoC4mQgTgHiVCBOU4qNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Brand2 = _t, Brand1 = _t, Model1 = _t, Color1 = _t, Test2 = _t, Test1 = _t]),
    Custom1 = Table.TransformColumnNames(Source,(x)=>Text.TrimEnd(x,"1"))
in
    Custom1

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.