How to Rename Column Headings with Power Query - the quick automated way

preview_player
Показать описание
⏬ Click Show More to check out the description for info and links⏬

Excel and Power BI users sometime need to rename multiple columns automatically rather than manually. e.g. auto replacing parts of the names, or using a manual table of "Before and After" to rename your columns.

I explain 2 methods List.Zip and the simpler Table.ToRows

00:00 Intro
00:20 The Scenario & the general approach
02:11 Create the From and To table
04:34 Creating the List of Lists using List.Zip
07:54 Table.ToRows method

'**************

Nice single line of code solution from Geert in the Comments to extract everything after the underscore

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

'****************

File to Download

Matt Allington's video

Did you know I've written a book "Power BI for the Excel Analyst"?

Connect with me
Рекомендации по теме
Комментарии
Автор

I've watched many related videos but the way you explain is way more clear and simple. Thank you so so much

HungLe-pkoz
Автор

very nice lecture specially: Shift+Down Arrow selects the step name, then Shift+9... wonderful

zahoorsarbandi
Автор

Nice video and tips... "shift + 9", I'll only add that the concept behind is: mark the text and "open whatever bracket you need", then you'll have the seleted text with both ( ), { }, [ ].

hfjsfhl
Автор

Hi Wyn,

My approach was: Use Headers as first Row, Transpose, Apply transformations needed to column 1 which contains the names of the original columns. Transpose, Use first row was headers

alexbarbucristi
Автор

Very informative! Love the clear explanation. 🙏🏿

God......
Автор

Hi Wyn,
Here's a one step solution that gets straight to the point. In your rename step use this formula:
= Table.TransformColumnNames(Source, each Text.AfterDelimiter(_, "_"))
and be done with it. 🙂
You're welcome.

GeertDelmulle
Автор

That's a lifesaver! It's exactly what I need for my current task at work.

radu_sirbu
Автор

Awsome! I have seen other long approaches but this is the one. Thanks a lot Wyn

mcwahaab
Автор

Hi Wyn, great video, really useful. Thank you. 👍👏

paulsingleton
Автор

Sir, plz make video for below.
If
1 table has 9 column,
2 table has 10
and 3 table has 8 .
Then how can we make equal all column for all table.. like we want to insert dummy column for missing column in tables and make equal like 10 column for each table.

danishnawaz
Автор

Great video! Related to your “clicks” comment, how much M do you write in your work now? I feel like I’ve reached a place with PQ that that is what I should focus on now, but seldom feel like I have a use case that can’t be solved with the “clicks.”

dbalkin
Автор

Still getting error. I jave two tables 2022sales, 2023 sales. In first file i have columns carname, year, number of units
sold, country. In secnd file i have diffent name number of units as (units) and county as (place) . Ihave created maping tabme exactly and turn it to rows and using in my sample file query. Now the second still shows error not displaying records.a red line across all headers. All date types are checked though

kalyanreddy
Автор

I have spreadsheet with new and old columns names. I see there are lot of steps in video. Could you please let me know how to rename the columns in the table using the spreadsheet. I tried few steps what you showed in the video. getting error like cannot convert a value of type table to type list.

Mohammad-rzoj
Автор

When I refresh query once i get a new file, will it read the data?

exceltina
Автор

I keep getting We expected a RenameOperations value error.... :(

AndrewCragg-yv
Автор

Will this approach work if i unpivot data? And download link is not working

ajayrathod
Автор

How would you handle the error that the field name already exists in the record? I have that error and although I can tell the rename function how to handle missing values there isn't anything tat will say this is what to do when you have an existing name.

PeterWalker
Автор

I have a question based on the power query how can I get in touch with you? Do you have an email address or any other means of communication apart from this platform?

bembeyerenkhoma