How to make a Stock Market dashboard in Google Data Studio
In this post I’ll explain the steps to creating a Stock Market dashboard in Google Data Studio. This will display the prices of shares in companies.
I’ve created one below, but you can customize the various stocks shown to what interests you.
1. Create a Google Sheet with Company share prices
The first step is to use one of the Google Finance formulas to get share prices.
For example, the formula below allows us to get share prices for today and a previous point in time.
=GOOGLEFINANCE(ticker, [attribute], [start_date], [end_date|num_days], [interval])
For example, the formula below gets the price for Google for today and the previous 365 days.
=GOOGLEFINANCE(“GOOG”,”price”,TODAY()-365,TODAY())
If we place this in the top left cell of a spreadsheet, we get a list of all the dates and share prices.
We can do this for a range of different stocks, so we can have multiple different share prices.
In this example, I decided to get the share prices for the following companies and place them in a separate sheet within one Google Sheets spreadsheet.
Now we have our different share prices, and we can start thinking about creating a Data Studio report with them.
However, we first need to place them into a separate spreadsheet in order for the data to be pulled in correctly to Data Studio from Google Sheets.
2. Create a second Google Sheet to act as a Data Source
Much like the previous post, How to create a five year Currency Exchange Rate report in Google Data Studio, we need to create a second Google Sheet with our data so that it pulls correctly for Data Studio.
The reason for this was that I encountered issues pulling data from the original Google Sheet to Google Data Studio. I’m not entirely sure what the problem was / is but I found creating a second sheet solved it. You might not have this issue.
To do this we need to use the IMPORTRANGE function.
=IMPORTRANGE(spreadsheet_url, range_string)
We can then import the data from our Combined data sheet into a new spreadsheet.
This sheet will be the data source for Google Data Studio.
3. Create the Google Data Studio report
Add in the data from our second Google Sheet into Google Data Studio. We can change the type to Currency > USD.
From there, you can do what you want with the Data Studio. In this example report I’ve used scorecards, time series charts to show the data.
The chart below shows the stocks over time.
The data is set up like this;
To get around the issue that some days (for example saturdays and sundays) may have no values you need to change one of the time series settings to ‘Linear Interpolation’. You can find this setting in the Style tab of the line chart.
I’ve also setup various scorecards for the different stocks, and added the company logos.
Because I’ve set the report up to show the close price of the previous day, it’s possible that sometimes these scorecards show “no data”.
There are a lot of different ways to use the Google Finance functions, so spend time playing around and experimenting. You can customize them for your own Stock Market dashboard if that’s something you’d want to make.
Download Google Data Studio Templates
If you’d like to download one of my Google Data Studio reports as a template to use for your own data, you can visit Data Studio Templates and purchase one.
My Other Blog Posts
If you liked this article you might like my other blog posts.
Or you can follow me on Twitter!
In step 1, toward the Botton where are you showing all stock on to one google sheet. how do you get the date to update so the data stay relevant? This is pretty confusing and the Vlookup function will not work unless you update the date into the combined sheet. thank you for sharing.
The formula always displays data for the previous year, so it is always up to date. =GOOGLEFINANCE(“GOOG”,”price”,TODAY()-365,TODAY())
Since GOOGLEFINANCE API generates price of weekdays, there is no data of weekends in step 1. When I generate time series graph with the data, the graph shows that the price in weekends as $0. How did you handle this?
And why do we need to create a second Google Sheet? Why not using the original sheet?
Also, it will be very helpful that you share the example link of google sheet and data studio.
Hi NK
Thanks for raising these questions. I’ve updated the blog post.
To get around the issue that some days (for example saturdays and sundays) may have no values you need to change one of the time series settings to ‘Linear Interpolation’. You can find this setting in the Style tab of the line chart.
So if I remember correctly there was an issue pulling data from the first sheet. It simply did not appear in google data studio when I tried it. Using the IMPORTRANGE function and copying the data into a second sheet, and then connecting the second sheet to Google Data Studio solved the issue for me.
I don’t think I’m able to share the link to the google sheet, but are you not able to re-create it using the information I have provided?
Hi thanks so much for this article. I’m trying to do something similar to you. I’m unfamiliar with the Studio but I’ll look into it. Looks interesting. I have just been using Google Sheets. My problem is…I can do the historical information…that’s easy enough. But I’d like to try and get real time data plotted on a chart. The googlefinance function has real time data but I cannot figure out how to freeze the data once it has been displayed. The googlefinance function updates every few minutes or so. Since it is a volatile function it just updates to the current time and the previous value is lost forever. Is there a way you can think of to save the data so that it doesn’t disappear? This way it could be plotted in a daily chart…
Hi I’m not too familiar with the details of google finance in google sheets. Hope you manage to figure it out!
You cannot create a real-time dashboard as the numbers are delayed by 20 minutes. Check the help center page under attribute – “price” – Real-time price quote, delayed by up to 20 minutes.
Thanks for the tutorial! I’m going to dig further into it but I’m wondering if it’s possible to add any filtering Data Studio to only show certain companies. I’d like to see how my portfolio is fairing over time but say I wanted to just see a category, like “online service” which would only show me Facebook and Twitter in the graph. Is that possible? I’ve been trying to find guides on this but haven’t gotten very far.
Sure – you could add in a filter to filter only specific companies or switch between companies.
When I try to import the data sheet, the only dimension it is giving me is ‘Record Count’. Have you encountered this error?
Do you mean the ‘metric’ is record count?
Maybe you need to switch the Stock values from text to number?
Hi
I try to use the formula =GOOGLEFINANCE(“GOOG”,”price”,TODAY()-365,TODAY())
and it gives me an ERROR
Try re-type commas ”
the formatting might be copied from the site