Forum Discussion
How to connect google sheet to Power BI
- 10 years ago
2023 update - the method below is no longer required, the native connector to Google Sheets is generally available. This supports Google authentication, so the data no longer needs to be public.
https://learn.microsoft.com/en-us/power-query/connectors/google-sheets
**** BELOW IS NOW OUT-OF-DATE ****
The easiest way is to Get Data / From Web, then enter the URL to your google sheet, with "&output=xls" on the end, e.g.
http://spreadsheets.google.com/pub?key=r1hlZB_n1rpXTij11Kw7lTQ&output=xls
PBI then analyses the resulting Excel file, showing the tabs as tables , which you can edit and manipulate.
I think it now takes a little more doing than just the "&output=xls" on the end of URL. Here's a robust solution that I've tested and used quite a bit to get full data out of Google Sheet. Apologies for all the steps:
1. Use Power BI desktop (this won't work just on Power BI service you have to start on desktop).
2. Share Google Sheet and get link from sharing.
3. Paste Google Sheet shared link and it will end in something like "adfe/edit?usp=sharing"
4. Remove the /edit?usp=sharing off the url
5. then add export?format=xlsx&id= where the edit/? had previously started
6. then copy and paste the long id from the first part of your url
7. the long, final URL you should use for Power BI get from web will be something like:
"https://docs.google.com/spreadsheets/d/1nWV8adkjfadkfHWDIAa3ad/export?format=xlsx&id=1nWV8adkjfadkfHWDIAa3ad"
NOTE: id after equals sign matches id from Google for share sheet. (BTW this isn't a real link just demonstration).
That's it - now you can design in Power BI desktop and publish to Power BI service on web (if needed). Only downside is there's no automatic refresh. Folks can edit / enter on Google Sheet but change won't appear in Power BI Desktop until you click refresh and won't appear in Power BI Service until you republish and overwrite. To attempt quasi-automation from a Google Sheets data source, you might want to consider saving your PBIX desktop file in your OneDrive folder since the Power BI service could update that hourly, that could potentially at least eliminate the final step in refreshing Power BI service. As soon as folks make changes to Google Sheet, you simply click refresh in Power BI Desktop which will fetch and refresh visuals based on updated data, but then just save that updated PBIX file in a OneDrive folder that is published to Power BI service and it should update automatically within an hour.
Hi,
Tried using this, however after building connection it doesnt load the file properly. With other methods too, constant error is this the table view has 4 columns (not part of usual data base). Even after i move ahead from preview, the actual data doesnt load