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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Anonymous
Not applicable

rename columns

Hello,

 

I have 14 dimension tables, and each table contains between 10 and 20 columns.
After importing the tables from my database, the columns were named as:  source_dim_name_of_table. name of columns

I want to rename all the columns keeping only the part after the . ie keep only name of columns. source_dim_name_of_table. name of columns
can someone help me please, because apart from doing it by hand, I don't see how I can do it otherwise.

 

Thank you for your help.

1 ACCEPTED SOLUTION
jennratten
Super User
Super User

Hello - it would be best to do this in Power Query.  You can do this by adding a new step to each table and use the Table.TransformColumnNames function, like this:

 

RenameColumns = Table.TransformColumnNames ( Source, each Text.AfterDelimiter ( _, "." ) )

 

Here is the full sample table with script:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSAeJYnWglIyDLCMwyBrKMlWJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [source_dim.Test1 = _t, source_dim.test2 = _t]),
    RenameColumns = Table.TransformColumnNames ( Source, each Text.AfterDelimiter ( _, "." ) )
in
    RenameColumns

 

BEFORE

jennratten_0-1646396133902.png

 

AFTER

jennratten_1-1646396158358.png

 

 

 

View solution in original post

3 REPLIES 3
jennratten
Super User
Super User

Hello - it would be best to do this in Power Query.  You can do this by adding a new step to each table and use the Table.TransformColumnNames function, like this:

 

RenameColumns = Table.TransformColumnNames ( Source, each Text.AfterDelimiter ( _, "." ) )

 

Here is the full sample table with script:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSAeJYnWglIyDLCMwyBrKMlWJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [source_dim.Test1 = _t, source_dim.test2 = _t]),
    RenameColumns = Table.TransformColumnNames ( Source, each Text.AfterDelimiter ( _, "." ) )
in
    RenameColumns

 

BEFORE

jennratten_0-1646396133902.png

 

AFTER

jennratten_1-1646396158358.png

 

 

 

Anonymous
Not applicable

Hello @jennratten , thank you so much, it works 🙂

Syndicate_Admin
Administrator
Administrator

Hi,

 

Not sure if this will work but it is my best idea so far:

 

1. Get the list of column names, following the suggested approach here: Get Collection Column Names - Matthew Devaney
2. and then try something like: ForAll(columnNames, RenameColumns(dataTable, columnName, Split(columnName, ".")[2]))

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.