I am trying to connect google sheet with power bi using R Studio, there is a video on youtube by stephnie locke, but that is just a short video and dont help completely. any one there which can help properly and completely.
If you're not limited to R Studio, there is another way to access Google Sheet data from Power BI:
Sample data:
Get shareable link of the Google Sheet (Permission at least Anyone with the link can view):
Modify the shareable link and add the following parts:
From:
https://docs.google.com/spreadsheets/d/google-sheet-guid/edit?usp=sharing
To:
https://docs.google.com/spreadsheets/d/google-sheet-guid/export?format=xlsx&id=google-sheet-guid
e.g.
https://docs.google.com/spreadsheets/d/1ohAz8SD6viEGIrcor-JC-vCt2yRbgY1c-7Uflv-_hrA/edit?usp=sharing
->
https://docs.google.com/spreadsheets/d/1ohAz8SD6viEGIrcor-JC-vCt2yRbgY1c-7Uflv-_hrA/export?format=xlsx&id=1ohAz8SD6viEGIrcor-JC-vCt2yRbgY1c-7Uflv-_hrA
Create a blank query in Power BI and get the source as below:
let
Source = Excel.Workbook(Web.Contents("the-link-in-step-2"), null, true)
in
Source
If you drill into the Table cell you should be able to see the data and work from there.
An easier way:
Go to Get data, search Web.
Select Web
Select Web
on the URL.
-> Modify the URL.
From:
https://docs.google.com/spreadsheets/d/emphasized textgoogle-sheet-guid/edit?usp=sharing
To:
https://docs.google.com/spreadsheets/d/google-sheet-guid/export?format=xlsx&id=google-sheet-guid
Paste.
Paste link
And there is your sheet.
Select your sheet
To build upon #Joseph A's perfect answer, if you would like to make it refreshable after publishing your report to the Power BI service from Desktop:
Navigate to the workspace where the report is published (i.e. My Workspace)
Click Datasets
Under Actions, click the ellipses and choose Settings
Expand Data source credentials and click Edit Credentials
Change Authentication method to Basic
Enter User Name and Password of Google Docs account where the file resides and click Sign In
Your report can now be refreshed and updated (manually or scheduled) to reflect changes in your Google Sheets doc!
Related
as I'm not a web developer by any means, this is me just asking a question for that I have not found a solution for.
I have a google sheet with multiple pages/sheets within it. the file is embeded in an iframe inside a webpage and I pulled the url and can open it directly using the url. the following link is just an example as I can't share the actual link since I am not allowed to:
https://docs.google.com/spreadsheets/d/e/{key}/pubhtml?widget=true&headers=false
I have tried this:
https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key={key}
and is not working I get an error:
Sorry, unable to open the file at present.
Please check the address and try again.
the file is not meant for anyone to download nor share. Furthremore, since it is continuosely manually updated by author and I need to keep track of updates, taking screenshots is not efficient since the file is too big.
is there any way I can download the actual sheet to my device (so I can compare file updates over the long run)
Thank you.
I believe your goal as follows.
You want to download a Google Spreadsheet.
You are the owner of Google Spreadsheet.
The Spreadsheet is published as the Web publish. So the URL of Spreadsheet is https://docs.google.com/spreadsheets/d/e/2PACX-1vTl9bcwMSjoxYj406evzJefFodkVEUlV2KIq34Y5V8BFWJygAFrPSA7L5d89TASDUjkPG4b2SfN2rpe/pubhtml?widget=true&headers=false.
Issue and workaround:
Unfortunately, the Google Spreadsheet cannot be directly downloaded as the Google Spreadsheet. It seems that this is the current specification. In this case, it is required to export the Google Spreadsheet as other mimeType. For example, it's XLSX format, PDF format and CSV format. But the URL of https://docs.google.com/spreadsheets/d/e/2PACX-1vTl9bcwMSjoxYj406evzJefFodkVEUlV2KIq34Y5V8BFWJygAFrPSA7L5d89TASDUjkPG4b2SfN2rpe/pubhtml?widget=true&headers=false cannot directly export. So, in this answer, as a workaround, I would like to propose to use the URL for exporting Google Spreadsheet as other mimeType.
When your URL is used, the URL for exporting is as follows.
Modified url:
https://docs.google.com/spreadsheets/d/e/2PACX-1vTl9bcwMSjoxYj406evzJefFodkVEUlV2KIq34Y5V8BFWJygAFrPSA7L5d89TASDUjkPG4b2SfN2rpe/pub?output=xlsx
In this case, when you access to above URL using browser, your Spreadsheet can be exported as a XLSX file.
When output=xlsx is modified to output=pdf and output=csv, you can export as a PDF file and a CSV file, respectively.
When you want to export the specific sheetm please use the sheet ID like gid=0. The URL is as follows.
https://docs.google.com/spreadsheets/d/e/2PACX-1vTl9bcwMSjoxYj406evzJefFodkVEUlV2KIq34Y5V8BFWJygAFrPSA7L5d89TASDUjkPG4b2SfN2rpe/pub?output=xlsx&gid=0
Note:
When you want to make users downloading the Spreadsheet, you can add the tag a as follows.
Download
I have a Google spreadsheet which compiles scheduling info for an event. The file has five worksheets. There are two worksheets which I want to publish to the web; the other three are for my use and to drive calculations.
I can see how to publish the entire file, and how to publish an individual worksheet. However, I cannot figure out how to publish say, sheet1 and sheet2 to a single document.
As a short-term workaround I have tried the following, which works after a fashion but I'm not a fan:
Create a new file with two sheets
Sheet1 uses an importrange call to grab the data from the original sheet1
Sheet2 uses an importrange call to grab the data from the original sheet2
I then publish the entirety of the new document
The finished product must be in Google Apps; that is a requirement I cannot dodge.
Solution 1:
You can hide the sheets that you don't want to publish, and then publish the entire document:
Published sheet:
Solution 2:
You can publish selected sheets using the Published Content & Settings options on the Publish to the Web dialog box. In the dropdown menu you can select which sheets to include:
The published spreadsheet would look like this:
Note: It seems that the web page may not display all the selected sheets, only the first sheet. You can file a feature/bug request here:
https://support.google.com/a/answer/6284762?hl=en
What worked for me is that after publishing the spreadsheet, copy the link, then through "Published content & settings" remove the check next to "entire document" and select the ones you want to share.
The details in the upper part of the window will disappear including the link, and the publish button will be green again "pressable".
Your copied link is still active, you can still use it, and only the selected sheets will be seen on the web. It is also modifiable; if you checked different sheets, web share will be updated accordingly.
I'm investigating if it's possible for a user to: Pick a file on disk, automatically upload it to Google Sheets, do some edits, and write the changes back to the file.
I basically want to use Google Sheets as the Editor of the local file.
Has anyone tried something like this, or can confirm if it's a feasible idea?
My rough idea:
Install a script or program, that a user (on our team) can execute with the appropriate file they pick.
Typically they right-click a file and pick "Open with MyGoogleSheetsCreate".
The ToSheets-script does the following:
Generates a temporary Spreadsheet on the user's Google Drive (or possibly a Team Drive/Folder for temp files)
Reads the custom data in the local file and enters it into the Spreadsheet.
Opens a Browser window with the generated spreadsheet.
The user makes some changes to the spreadsheet.
The user exports the changes back to the file.
User initiates this how? Some ideas:
Perferably: I build a button or menu option to "Export back to Local Disk". This would only be viable if we could explicitly say where to save this custom file, i.e. where it came from.
Optionally: They right-click the original file and pick "Open with MyGoogleSheetsRetrieve". The importer would need to know the address of the Google Sheet the local file was last exported to.
FromSheets-Script converts the Spreadsheet into our custom data format and overwrites the old file.
Bonus: The temporary Google Sheet would be automatically moved to the Bin within a couple of days (without user interaction).
I think I've got a good idea of how to convert our custom format to Sheets and vice versa. The steps I'm most unsure of are: 3.1 and 5.1
I want fetch the table details from https://www.edelweiss.in/market/nse-option-chain in a gogle sheet, I had used the formula
=IMPORTHTML("https://www.edelweiss.in/market/nse-option-chain","table",1) , but getting the empty error.
Unfortunately, the =IMPORTHTML cannot be used because the website you're trying to get the data from load the data dynamically.
Possible solution
A possible solution to gather the data might be found if you follow these steps:
1. Identify the the URL that is making the request with the data you want
You can do this by using the Google Chrome Console and checking the Network Tab and filtering the requests by XHR.
2. Import the IMPORTJSON library and use Apps Script
Install the library by accessing this link here. You should install the library by using Apps Script and going to Tools -> Script Editor -> add the ImportJSON.gs.
3. Use the formula in your Sheet
You could use the formula like this:
=ImportJSON("THE_LINK_FOUND_AT_STEP_1")
Reference
ImportJSON Library
I am trying to migrate an Excel sheet to Google sheets and having a problem with the links to folders as can not get them to work. Tried to use this format:
=HYPERLINK("Folder/sub Folder","link label")
Is there a way to get the folders to open or is it just not possible because Google sheets is web based and the security permissions won't allow it to open a windows folder?
The HYPERLINK() function of Google Sheets requires as first parameter a URL.
If you want to include a link to a Google Drive folder you should use the URL of that folder. The sharing URl of a folder looks like the following one
https://drive.google.com/folderview?id=1B5xqUTMMK_n6NmdkTUhsbUd9SE0&usp=sharing
The URL of a folder taken from the Google Drive UI looks like the following one
https://drive.google.com/drive/u/0/folders/1B5xqUTMMK_n6NmdkTUhsbUd9SE0
Note: I changed some characters of the real folder ID to prevent access requests.