Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to extract column names from a table

Hi All

 

I have imported a SQL Server table. I want to get the column names of that table. Have gone thru the below link and tried the solution specified. The solution lists the table name and column names, but the values are not persistent. Cannot use that in report.

 

https://community.powerbi.com/t5/Power-Query/Getting-a-list-of-all-columns-in-all-tables-in-the-data-model/td-p/780229

 

Looking for something like this:

 

Table NameColumn Name
Table1Column1
Table1Column2
Table1Column3

 

  • Anonymous 

    In each Table you need to 

    1. Demote the Header as First Row

    2. Transpose

    3. do this all tables

    4. append all tables and remove unnecessary columns

    you will get the result. Hope this helps you

     

2 Replies

  • VijayP's avatar
    VijayP
    Icon for Community Champion rankCommunity Champion

    Anonymous 

    In each Table you need to 

    1. Demote the Header as First Row

    2. Transpose

    3. do this all tables

    4. append all tables and remove unnecessary columns

    you will get the result. Hope this helps you

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you VijayP . That is a good work around, even though have to do this for each of the tables.