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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
anantv
New Member

Copy header column only

Hello,

My data table has more than 100 columns. I would like to just copy column headers and paste into excel and verify column names with another table. 

How do I just copy column headers only? I have been using 'copy table' and just keeping column headers only for verification.

Thanks

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @anantv ,

 

In Power Query, just create a new blank query and paste this over the default code in Advanced Editor:

let
    Source = Table.ColumnNames(queryName)
in
    Source

 

...where 'queryName' is the name of the query that you want the list of column names for.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

4 REPLIES 4
BA_Pete
Super User
Super User

Hi @anantv ,

 

In Power Query, just create a new blank query and paste this over the default code in Advanced Editor:

let
    Source = Table.ColumnNames(queryName)
in
    Source

 

...where 'queryName' is the name of the query that you want the list of column names for.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Pete,

Thank you very much. This is exactly the solution, that I needed.

 

Thanks

rubayatyasmin
Super User
Super User

Hi, @anantv 

 

Assuming you are using Power BI.

 

1. Just export the table to csv. open the file, the first row should contain column names, just select the first row or the row that contains column names then copy paste it. 

 

or 

  1. Go to Edit Queries > Transform > Structured Column > Expand to New Rows.
  2. Then, go to Home > Keep Rows > Keep Top Rows > 1.
  3. Apply & Close

this will only have column names. 

 

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Hi Rubayatyasmin,

Thank you for the response. 

I had been extracting column names as option 1.

I was not able to use the second option (seems very interesting) as Structured column menu grouping is not available in my organization's O365 Power BI.

I appreciate your help. Thanks.

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors