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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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 Kudoed Authors