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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
suidino2
Frequent Visitor

Dataflow to lakehouse, bulk change header to appropriate format

In my scenario, many current data source table has space in the header name. I understand that when loading data to Lakehouse, table header can not have space in it. Is there a way to bulk fill the header space? Or any other function that can change header to appropriate format? 

1 ACCEPTED SOLUTION
miguel
Community Admin
Community Admin

Hi,

There's a couple of things that you can do to tackle this. 

 

The UI way

  • Reference your query twice miguel_6-1685163764002.png

     

  • In both references make sure to demote the headers miguel_0-1685163327601.png

     

  • Let's say that one of the referenced queries will be called "Headers" and the other one will be "Data"
    • For the Headers query:
      • Keep only the top 1 row miguel_1-1685163430190.png

         

      • Apply the "Replace values" transform to every single column in your query miguel_2-1685163500339.png
    • For the Data query:
      • Remove the top 1 row miguel_3-1685163582881.png

         

    • Append the Headers and Data query in that exact order miguel_4-1685163689308.png

       

    • Promote the first row to be the headers of the column miguel_5-1685163726980.png

       

    • Remove the now top 1 row of the table

miguel_8-1685163835803.png

 

The M script way requires you to first use Table.ColumnNames to get the list of columns of your table, then use a function like List.Transform to establish how you'd like to transform such list of columns and then the use those two pieces to pass the arguments required for the Table.RenameColumns function and perhaps using the List.Zip function to create that list of lists (of previous and new column names).

 

Let us know if this helps!

 

View solution in original post

1 REPLY 1
miguel
Community Admin
Community Admin

Hi,

There's a couple of things that you can do to tackle this. 

 

The UI way

  • Reference your query twice miguel_6-1685163764002.png

     

  • In both references make sure to demote the headers miguel_0-1685163327601.png

     

  • Let's say that one of the referenced queries will be called "Headers" and the other one will be "Data"
    • For the Headers query:
      • Keep only the top 1 row miguel_1-1685163430190.png

         

      • Apply the "Replace values" transform to every single column in your query miguel_2-1685163500339.png
    • For the Data query:
      • Remove the top 1 row miguel_3-1685163582881.png

         

    • Append the Headers and Data query in that exact order miguel_4-1685163689308.png

       

    • Promote the first row to be the headers of the column miguel_5-1685163726980.png

       

    • Remove the now top 1 row of the table

miguel_8-1685163835803.png

 

The M script way requires you to first use Table.ColumnNames to get the list of columns of your table, then use a function like List.Transform to establish how you'd like to transform such list of columns and then the use those two pieces to pass the arguments required for the Table.RenameColumns function and perhaps using the List.Zip function to create that list of lists (of previous and new column names).

 

Let us know if this helps!

 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors