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.
Hey trebgatte I can follow all these steps but the only thing that loads is your 100 columns - none of my Google Sheets data. Am I doing something wrong.
Did you get your own developer id?
- ImkeF8 years ago
Community Champion
Hi there,
I found a custom connector for OAuth2 - authentication for Google Sheets. See how this worked for me here: http://www.thebiccountant.com/2017/09/24/custom-connector-import-google-sheets-oauth2-powerbi/
- ImkeF8 years ago
Community Champion
Hi dosansil and Anonymous:
I made a stupid mistake here, so the solution doesn't work unfortunately: I didn't recognize that the sheet I was referrig to was still published to web. So despite me restricting the access in the "share"-area, there was still the published web-option which accepted my credentials. But the problem here is, that I actually didn't need credentials, as the anonymus connection would have worked as well.
I'm very sorry to have wasted your time here!! (Will edit/delete my orignal post so that others will not get fooled as well)
- trebgatte8 years ago
Most Valuable Professional
I have the basic process here in my post. https://tumbleroad.com/2016/07/07/free-marquee-google-sheets-template/ Do not use my sample developer id as this will not allow you to connect to your data.
However, this is the latest Google docs on the process: https://developers.google.com/identity/sign-in/web/devconsole-project Unfortunately there are no screenshots to walk you through this process. If you use the terms from the process above on getting the ID process and the updated doc link, you should be able to navigate through the new Google UI. I'm putting this on the backlog for update.
Treb Gatte | MVP | TumbleRoad.com | PowerBICertification.com
- mike_honey9 years ago
Memorable Member
I got asked by another client to look into a secure/API connection direct to Power BI again.
My conclusion is that the only Google API Authorization option now is the dreaded oAuth2, which is beyond the capabilities of Power BI.
I did have a look at Treb's blog post, but that seems to get tripped up by the same change in the Google API.
FWIW my proposed workaround is to use Microsoft Flow to read from Google Sheets and write the rows to an Excel file stored in OneDrive, running on a schedule. I got a crude prototype running quickly so it seems viable.
Hope this saves others some time.
Obviously the best solution would be for Microsoft to add Google Sheets connectivity with integrated authorization - if you agree please add your votes and comments here - maybe it will be delivered before it's 3rd birthday ...
- ImkeF8 years ago
Community Champion
Deleted the thread because the "solution" actually didn't work.
- ImkeF8 years ago
Community Champion
Yes, paste the URL that you've copied from Google sheet there.
The dialogue for the authentication will appear after that step.
- dosansil8 years ago
Helper I
The next step is not the authenticator, is this screen, with a blank document:
Thanks!
- Anonymous8 years agoNot applicable
delete
- dosansil8 years ago
Helper I
Hello, ImkeF. Don't worry. You are always helpful and gently. I'm grateful for your try and good assistance. If you discovery a solution, let me know. Thanks!
- trebgatte8 years ago
Most Valuable Professional
I'll have to revisit the blog post as there were some changes on how to get the developer id on the Google side. Once you have the developer id, it connects securely and off you go.
I used it last week so I know it is working. The new API reports back the number of columns now but I have no idea where they are deriving that number. I had a nine column sheet and it told me I had 15 columns. If you set the fold to 15, it really jacks up the data.
Updates will be forthcoming.
Treb Gatte | MVP | TumbleRoad.com | PowerBICertification.com
- Anonymous8 years agoNot applicable
how do I get a developer id from google?
- ImkeF8 years ago
Community Champion
trebgatte I played around with it some more and could make your code work only if I allow everyone access who has a link. Then anonymus connections works, as the API key does it's job (just like your sample file in the comments with the cocktail receipes)
Do you know how to tweak the code so that it works with specific users and a user authentication dialogue pops up ?
- trebgatte8 years ago
Most Valuable Professional
Basically, what you show to get the client secret and all is what I did to get mine working and it works in the service since it's not a custom connector. Perhaps that's what people are missing.