Marquee™ for Google Sheets
Microsoft Power BI isn’t just for getting data from Microsoft products. The PBIX demo file that you can get once you register below, allows you to query the data from your Google Sheet into Power BI and then share resulting reports and dashboards via PowerBI.com with co-workers or the world if you desire. If you have the Power BI mobile app, you now have Google Sheets data on the go.
Demo File Only
This PBIX is provided as a demo only, with no support or warranty offered as a result. Testing was only sufficient for a demo and not for production use. You may encounter errors in your environment with the use of this model in it’s current state. You are welcome to expand the solution. If you do, please add to the comments below so that we can all share from your experience.
Note: the PBIX file only connects to the first tab in your Google Sheet.
Google Sheets API Oddities
This was an interesting project as Google Sheets doesn’t have the same concept of table as Excel does. Therefore, there’s two conditions you may encounter for which we don’t yet have a good solution.
First, you shouldn’t have a blank column heading. This will cause the model to error out on the last data transformations as Power BI expects column headings to be present.
Second, the Google Sheets API doesn’t appear to return cells that are null that are in the last column of your sheet. Since the cells are returned as a list and we fold the list every X rows, this throws off the row count and fold points. As a workaround, we recommend having the last column of data have values in all cells.
You need three pieces of data in order to use this PBIX file.
- The number of columns in the Sheet
- Your Spreadsheet ID
- Your Browser API Key
Steps to get your SpreadsheetID
- Navigate to your Sheets page.
- The key is in the URL, see the bolded red text below.
Steps to get your Browser API Key
- Log into your Google account
- Click this link to start the wizard.
- Click Agree and Continue button to create a new project.
- Unfortunately, you have to create the following, even though we won’t use it.
- Click Go to credentials button.
- Select User Data under What data will you be accessing?
- Click What credentials do I need? button
- Click Create client ID button
- Enter a Product name
- Click Continue button.
- Click Done button.
Now to create the credential we need for this to work.
- Click the Create credentials button.
- Select API key.
- Select Browser key.
- Give it a name and click the Create button.
- Copy the API key and paste it into the BrowserAPIKey parameter.
Setting Up Your PBIX File for Use
Once you receive your PBIT file, do the following.
- You must have Power BI Desktop installed prior to performing this procedure.
- In File Explorer, double-click on the Google Spreadsheet Template – Final.pbit file.
- Power BI Desktop will open and you will be presented with this dialog.
- Fill in the values and click the OK button.
- The model will refresh and it should load your Google data.
Setting Up Scheduled Refresh on PowerBI.com
Once you have saved the model, verified the data and built your reports, you can publish this model to PowerBI.com. Once there, you can set it up to automatically refresh the data so that any reports and dashboards are up to date.
Procedure for Scheduled Refresh
- In Power BI Desktop, click File, Save to save the model
- Click Publish
- If you aren’t signed into Power BI, you’ll be prompted to do so.
- You may be prompted for the location to publish. My Workspace is the default
- Once done, go to PowerBI.com.
- Follow the procedure in the video below.
- Navigate to the Datasets in the left navigation to start the process.
- Note, the API key you entered earlier in the model is your login. This is why it is set to anonymous in PowerBI.com.