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

  Рет қаралды 15,077

Access Analytic

Access Analytic

Күн бұрын

⏬ 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
aasolutions.sharepoint.com/:f...
Matt Allington's video
• Rename all columns in ...
Did you know I've written a book "Power BI for the Excel Analyst"?
pbi.guide/book/
Connect with me
wyn.bio.link/
accessanalytic.com.au/

Пікірлер: 52
@HungLe-pk3oz
@HungLe-pk3oz Ай бұрын
I've watched many related videos but the way you explain is way more clear and simple. Thank you so so much
@AccessAnalytic
@AccessAnalytic Ай бұрын
No worries, thanks for taking the time to leave a kind comment
@zahoorsarbandi2982
@zahoorsarbandi2982 Жыл бұрын
very nice lecture specially: Shift+Down Arrow selects the step name, then Shift+9... wonderful
@AccessAnalytic
@AccessAnalytic Жыл бұрын
Thank you Zahoor
@RahulForPWBI
@RahulForPWBI 11 күн бұрын
Easy Peasy; Thank You so much!
@AccessAnalytic
@AccessAnalytic 11 күн бұрын
You’re welcome.
@alexbarbucristi
@alexbarbucristi Жыл бұрын
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
@AccessAnalytic
@AccessAnalytic Жыл бұрын
Nice technique with a small data set. Not sure what would happen with 500,000+ rows
@alexbarbucristi
@alexbarbucristi Жыл бұрын
@@AccessAnalytic Thanks for the heads up, will stop using it
@radu_sirbu
@radu_sirbu 9 ай бұрын
That's a lifesaver! It's exactly what I need for my current task at work.
@AccessAnalytic
@AccessAnalytic 8 ай бұрын
Excellent
@GeertDelmulle
@GeertDelmulle Жыл бұрын
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.
@AccessAnalytic
@AccessAnalytic Жыл бұрын
Nice Geert
@AccessAnalytic
@AccessAnalytic Жыл бұрын
I added it to the description section
@txreal2
@txreal2 Жыл бұрын
Where is the time stamp for this step? Thanks Geert
@AccessAnalytic
@AccessAnalytic Жыл бұрын
@@txreal21:21
@marcelakarinalopezortiz3373
@marcelakarinalopezortiz3373 10 ай бұрын
@@AccessAnalytic do you have a similar solution when you want to add a prefix/suffix?
@paulsingleton6071
@paulsingleton6071 4 ай бұрын
Hi Wyn, great video, really useful. Thank you. 👍👏
@AccessAnalytic
@AccessAnalytic 4 ай бұрын
You’re welcome
@mcwahaab
@mcwahaab Жыл бұрын
Awsome! I have seen other long approaches but this is the one. Thanks a lot Wyn
@AccessAnalytic
@AccessAnalytic Жыл бұрын
You’re welcome
@user-ez5os8nm2z
@user-ez5os8nm2z 2 ай бұрын
Excellent
@erdiaz39
@erdiaz39 Жыл бұрын
Awesome tips!!!
@AccessAnalytic
@AccessAnalytic Жыл бұрын
Cheers 😀
@josecarlosconejo5724
@josecarlosconejo5724 Жыл бұрын
Very Useful 😮 Impressive 👏
@AccessAnalytic
@AccessAnalytic Жыл бұрын
Cheers
@rudi-gruber
@rudi-gruber Жыл бұрын
very helpful, thanks
@AccessAnalytic
@AccessAnalytic Жыл бұрын
You're welcome 😀
@telclissonperes
@telclissonperes 9 ай бұрын
Thank you so much!!!!
@AccessAnalytic
@AccessAnalytic 9 ай бұрын
No worries
@felipesignorellireis7839
@felipesignorellireis7839 Жыл бұрын
Love it
@AccessAnalytic
@AccessAnalytic Жыл бұрын
Thanks
@dbalkin777
@dbalkin777 Жыл бұрын
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.”
@AccessAnalytic
@AccessAnalytic Жыл бұрын
Thanks, probably 10% on average is hand written code
@kalyanreddy6260
@kalyanreddy6260 Ай бұрын
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
@AccessAnalytic
@AccessAnalytic Ай бұрын
If you’re running this on a folder of files then you might want to add MissingField.Ignore Something like Table.RenameColumns(_,{{"Product","Item"}}, MissingField.Ignore) This should handle the fact that the columns you’re renaming don’t exist on one file
@danishnawaz3651
@danishnawaz3651 4 ай бұрын
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.
@AccessAnalytic
@AccessAnalytic 4 ай бұрын
That should happen automatically. Tables don’t need the same number of columns
@PeterWalker
@PeterWalker 9 ай бұрын
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.
@AccessAnalytic
@AccessAnalytic 8 ай бұрын
Not sure, maybe some sort of pre check on the renaming table and add a 2 if text already exists if List.Contains( Table.ColumnNames(OriginalTable), [NewName] ) then [NewName] & "2" else [NewName]
@PeterWalker
@PeterWalker 8 ай бұрын
@@AccessAnalytic sounds like a course of action. Thanks for the response!
@exceltina
@exceltina 3 ай бұрын
When I refresh query once i get a new file, will it read the data?
@AccessAnalytic
@AccessAnalytic 3 ай бұрын
Yes it will
@bembeyerenkhoma
@bembeyerenkhoma Жыл бұрын
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?
@AccessAnalytic
@AccessAnalytic Жыл бұрын
Check out the description for my links, also for most questions I point folks to techcommunity.microsoft.com/t5/microsoft-excel/ct-p/Excel_Cat?WT.mc_id=M365-MVP-5002589 And community.powerbi.com/t5/Power-Query/bd-p/power-bi-services
@FredericLEGUEN-Excel
@FredericLEGUEN-Excel Жыл бұрын
Nice trick. And I love Shit + 9 😉
@AccessAnalytic
@AccessAnalytic Жыл бұрын
Cheers Frédéric
@GrainneDuggan_Excel
@GrainneDuggan_Excel Жыл бұрын
Fantastic timesaver and frustration remover! Wish I knew Shift+9 sooner! Thanks Wyn!!!!!! 👏👏👏👏👏👏
@mcnater
@mcnater Жыл бұрын
@@GrainneDuggan_Excel what does Shift + 9 do?
@GrainneDuggan_Excel
@GrainneDuggan_Excel Жыл бұрын
@@mcnater watch at about 2:35 min when you type a function name then Shift+Down Arrow selects the step name, then Shift+9 puts the (before and )after!!
@AccessAnalytic
@AccessAnalytic Жыл бұрын
Thanks Grainne, i wish I knew it sooner too 😆
What is a Date Table / Calendar table in Power BI / Excel
20:06
Access Analytic
Рет қаралды 34 М.
Power Query: Avoiding naming column headers to avoid breaks
16:01
David Benaim
Рет қаралды 21 М.
Como ela fez isso? 😲
00:12
Los Wagners
Рет қаралды 23 МЛН
ПЕЙ МОЛОКО КАК ФОКУСНИК
00:37
Masomka
Рет қаралды 10 МЛН
КАРМАНЧИК 2 СЕЗОН 5 СЕРИЯ
27:21
Inter Production
Рет қаралды 528 М.
Cat story: from hate to love! 😻 #cat #cute #kitten
00:40
Stocat
Рет қаралды 8 МЛН
The Magic of working with Records in Power Query
10:28
Goodly
Рет қаралды 34 М.
How to write a Multiple (nested) IF in Power Query
9:51
Access Analytic
Рет қаралды 13 М.
Transform Column Names in Bulk in Power Query
19:23
BI Gorilla
Рет қаралды 31 М.
The Amazing New Slicer and Card visual in Power BI (Tutorial)
16:14
Access Analytic
Рет қаралды 4,5 М.
Promote Double Headers in Power Query | Solution
17:02
Goodly
Рет қаралды 23 М.
Multiple Find / Replace with List.Accumulate() ~ Power Query
19:24
ELE QUEBROU A TAÇA DE FUTEBOL
0:45
Matheus Kriwat
Рет қаралды 10 МЛН
Car 1💵 vs 10000000 💵
0:21
Dung ABC
Рет қаралды 18 МЛН
Đào sắn trên rừng rất vui nhé
0:14
Nhung Phan
Рет қаралды 9 МЛН