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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Connect to Google Sheets

I connected Power BI using the Web option to Google Sheets. Works OK, but, the 1st row of sheet contains the header, Power BI doesn't recognize this and labels all columns Column1, Column2....ColumnN. I can manually rename them by adding steps in the Edit Query Window, but, this is not good as new columns will not be retrieved if the source changes. How can I force Power BI to recognize 1st row of data as headers? I don't see any options in the connection to do this.

 

This is how my connection looks :

 

= Web.Page(Web.Contents("https://docs.google.com/..../pubhtml", [Timeout=#duration(0, 0, 5, 0)]))
1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@Anonymous,

Instead of renaming all columns, you can click "use first row as Headers " option in Power BI Desktop query editor.
Capture.PNG1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yuezhe-msft
Employee
Employee

@Anonymous,

Instead of renaming all columns, you can click "use first row as Headers " option in Power BI Desktop query editor.
Capture.PNG1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks. This works great, I am now getting my column headers correctly. The issue I now have is that the order in which the columns appear in Edit Queries window is the correct one (same as in Google Sheets), but, when you view the table in the Data Window columns appear in Alphabetical order. In query editor I only connected to Google sheet, and then promoted headers to column names. Since I have many columns, and I need to create calculated columns for most, then it's very difficult as I don't know exactly what column I am working against.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors