Forum Discussion

christianjon17's avatar
christianjon17
New Member
10 years ago
Solved

How to connect google sheet to Power BI

Good day,

 

I would like to ask if how can I import google sheet to power BI?

 

For your assistance.

 

Thank you and God bless,

Christian

72 Replies

  • mike_honey's avatar
    mike_honey
    Memorable Member

    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.

    • gaillardb's avatar
      gaillardb
      New Member

      Mike,

       

      would you please help me locate the Get Data / From Web ...

       

      Get data gives me the following options:

      Import of Connect data

      Files or Database

       

      In database, I can't seem to find a way to paste a simple URL source. Thanks!!

      • mike_honey's avatar
        mike_honey
        Memorable Member

         gaillardb - It sounds like you are starting from app.powerbi.com ?  I didnt make it clear, but actually my solution uses Power BI Desktop.  That has much more "Get Data" functionality.

         

        BTW these forums arent great - if you want someone to be notified of your reply you need to mention them eg @xyz

    • Julieng's avatar
      Julieng
      New Member

      Mike,

       

      I am affraid your option doesn't really work anymore. I haven't been able to do it.

       

      Are you using the "shareable link" from google sheet, or the actual sheet URL ?

       

      Thanks !

       

       

       

       

      • mike_honey's avatar
        mike_honey
        Memorable Member

        From Google Sheets, go to File / Publish to Web.  Then change the selection from Web Page to Microsoft Excel.  Copy the generated link.

    • arifuddin's avatar
      arifuddin
      Frequent Visitor

      It only returns the first sheet? how do we get the other sheets?

  • 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.

     

    • mpalha04's avatar
      mpalha04
      Helper III

      Hi,

       

      I successfully connected to my Google Sheets data using this connector yesterday. However, when I'm hitting refresh I get the following error messages:

       

       

      No columns have changed in my source data, except that new rows got added. How can I resolve this issue?

      • jkaemmerling's avatar
        jkaemmerling
        Frequent Visitor

        Is the sheet connected to a form? 

        Is the column renamed in the source file? 

        Did anything happen to the source file that would change title, position or structure of column? 

        Also how many rows in the google sheet?

         

        Open the "Advanced Editor" in Query Editor and double check all of your syntax and see if any changes are being applied to that date column in the query.

         

        Last piece of advice which usually yields results for me: walk backwards step-by-step of all your data prep steps and see if you can deduce a pattern or where the error ocurred. Usually the errors are so miniscule us humans miss them.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello, 

    is there any possibility to connect google sheet if i do not have access to Google API (company limitation).

    and i can not setup document availible to anybody (as well company limitation).

     

    in fact when i insert the link, it gives me an erreur and i can see in Web View that Google indentification required.

     

     

    • jonas123's avatar
      jonas123
      Regular Visitor

      Hi!

       

      I had the same issue - what I did was that I created the project from my private Google Account. You can create a project, add the API:s and download the credentials. Then you just have to share the Sheet with the email in the credentials you downloaded! 🙂

      • komyji's avatar
        komyji
        Frequent Visitor

        hi, i have created a workbook on google sheets and i want to link it to power bi. This works for me, but as soon as I publish the report to power bi online and share it with someone, the data is not automatically updated. Is it possible to publish the report online and at the same time to update the data from the google workbook? Thanks