Skip to main content

Stock Portfolio Tracker Dashboard With Google Data Studio

In the series of building personal stock portfolio tracker, we have learned how to use Google Sheets to register transactions. We have then used the pivot table and GOOGLEFINANCE function to compute the latest position of the stock portfolio. We have made a step further to use Apps Scripts to compute automatically and daily the stock portfolio's evolution. However, after all, we have several tables of data as the result which do not tell any story yet. We need to present those data in graphs to understand the portfolio's performance and make improvements accordingly. We can effectively plot graphs in different aspects directly in Google Sheets as it provides many charting tools. However, in my experience, having charts and data in the same spreadsheet is not very convenient because charts and tables tend to overlap each other and of lack of interactivity. We should have a dedicated dashboard to have an overview of the stock portfolio and we can do it greatly with Google Data Studio.

Google Data Studio connects to Google Sheets to fetch data stored in spreadsheets and then to visualize those data into an interactive and beautiful dashboard. You can think of this solution as a separation of concerns:

  • Google Sheets plays the role of a database to the stock portfolio tracker. We will insert new transactions into it over time. We use built-in functions like GOOGLEFINANCE, pivot table, Apps Script, etc. to compute the position and evolution of the portfolio.
  • Google Data Studio plays the role of a graphical user interface to our stock portfolio tracker. It connects to the database, collects the prepared data, and visualizes them interactively and beautifully. It synchronizes closely with changes in the database.

In this post, I will show you how to create your own dashboard to monitor your stock portfolio using Google Sheets and Google Data Studio.

Free, easy, interactive, beautiful, real-time, no-installation-needed, and personal stock portfolio tracker

Create a report and connect data sources to spreadsheet

Google Data Studio provides a connector to Google Sheets which allows you to browse your spreadsheets and select exactly which sheet of a spreadsheet you want your report to access. You can connect many sheets to one report.

  • Make a copy of the spreadsheet presented in this post Demo stock portfolio tracker with Google Sheets
  • Create a new Blank Report from your Google Data Studio home page
  • Connect to the Transactions sheet as a data source for the report
    • Select the Google Sheets as the connector
    • In the Spreadsheet column, select the one that you copied at the first step
    • In the Worksheet column, select the Transactions sheet
    • Click Add button
    • Confirm Add To Report

Connect the Transactions sheet as data source to the report

  • Do it again to connect also Positions and Evolutions sheets as data sources for the report
  • From the top menu, select Resource > Manage added data sources, we will have 3 data sources as shown in the picture below

Configure 3 data sources for the report: Transactions, Positions, Evolutions

Create indicators with Scorecard

As a smart investor, you might want to know how much your stocks currently worth at a quick glance. You can do it with scorecards:

  • From the top menu of the report, select Insert > Scorecard
  • Select Positions as the data source for this scorecard
  • Select SUM Market Value as the metric for this scorecard
  • We will have a scorecard Market Value displaying the total value for stocks owned in the portfolio as shown in the sample report above.

As a smart investor, you might want to know how much money has been invested in the portfolio at a quick glance. You can do it with scorecards and filters:

  • From the top menu of the report, select Insert > Scorecard
  • Select Transactions as the data source for this scorecard
  • Select SUM Amount as the metric for this scorecard. Rename the metric as Invested Money
  • We only take into account the transactions of types DEPOSIT and WITHDRAWAL to calculate the Invested Money. At the Filter > Scorecard Filter section, add a filter, and configure it as in the picture below.

Filter to keep only transactions of types: DEPOSIT, WITHDRAWAL

  • We will have a scorecard Invested Money displaying the total value for stocks owned in the portfolio as shown in the sample report above.

Sample scorecards with Google Data Studio

As a smart investor, there are many other indicators that you might like to track. Can you create scorecards for those indicators?

  • How many stocks are there in the portfolio?
  • How much free cash is available in the portfolio?
  • How much dividend is accumulated in the portfolio?
  • How much is the current gain / loss in the portfolio?
  • How much is the current gain / loss compared to the invested money in the portfolio?

Track portfolio's evolution with Time series

As a smart investor, you might want to track the portfolio's value as well as gain / loss over time. You can do it with a time series chart with 2 series: one for the Gain on the right axis and one for the Portfolio Value on the left:

  • From the top menu of the report, select Insert > Time series
  • Select Evolutions as the data source
  • Select Date as Date Range Dimension
  • Select Date as Dimension
  • Select SUM Portfolio Value as the Metric
  • Add the second metric and select SUM Gain for it
  • Switch to the Style tab
  • In the General section, select Linear Interpolation for Missing Data
  • If the Gain and Portfolio Value can not be on the same scale, one can be plotted on the left axis, other can be plotted on the right axis.

Time Series for portfolio value and gain

As a smart dividend investor, you might want to track the dividend earned over time, by month, and by year. You can do it with a cumulative time series and drill down option:

  • From the top menu of the report, select Insert > Time series
  • Select Transactions as the data source
  • Select Date as Date Range Dimension
  • Select Date as Dimension
  • Click then the edit button and select Year Month for Granularity
  • Activate the Drill down to have options of plotting by month and also by year
  • Select SUM Amount as Metric
  • Rename the metric as Dividend
  • Create a filter to select only transactions of type dividend and add the filter into Time series filter in the Filter section
  • Switch to the Style tab
  • Select Cumulative for the Series #1

Time Series for dividend

As a smart investor, you might want to track the invested money over time, by month, and by year? Can you do it?

Monitor distribution of the portfolio with Bar chart

As a smart investor, you might want to compare the Cost and the Market Value among stocks of the portfolio. You can do it with a bar chart:

  • From the top menu of the report, select Insert > Bar chart
  • Select Positions as the data source
  • Select Symbol as the Dimension
  • Select SUM Cost and SUM Market Value as the Metric

Bar chart for cost and market value

As a smart investor, you might want to compare the Capital Gain % and Yield % among stocks of the portfolio. Can you do it?

Monitor dividend earnings by month and by stock with Pivot table

As a smart dividend investor, you might want to know the distribution of dividends by month and by stock. You can do it with a pivot table whose columns are months of year and rows are stocks presented in your portfolio:

  • From the top menu of the report, select Insert > Pivot table
  • Select Transactions as data source
  • Select Date as Date Range Dimension
  • Select Symbol as Row dimension
  • Select Date as Column dimension
  • Click then the edit button and select Month for Granularity
  • Select SUM Amount as Metric
  • Rename the metric as Dividend
  • Check Show Grand Total for both Rows and Columns in the Totals section
  • Select Dividend and Descending for Row #1 in the Sorting section
  • Select Month and Ascending for Column #1 in the Sorting section
  • Create a filter to select only transactions of type dividend and add the filter into Time series filter in the Filter section
  • Switch to the Style tab
  • Select Heatmap for the Metric #1

Pivot table for displaying dividend by stock and by month

As a smart investor, you might want to know the distribution of invested money by month and by year. Can you do it?

Interact with reports

As I mentioned earlier, with Google Data Studio, you can create a dashboard that is not only beautiful but also interactive. What I mean by an interactive dashboard is the ability to control dynamically which data used to display. With Google Data Studio, you have many ways for adding interactions to your dashboard.

Drill down

If your data is hierarchical, drill-down allows users to switch dynamically between levels of that hierarchy. For example, we can say transactions in a stock portfolio are hierarchical data by time because we can explore those data by year, by month, or even by date. As you have already added the drill-down option into your dividend and invested money time series above, let's see what it actually looks like.

Use drill-down to switch between month and year on a time series chart

Date range, filter control, data control

So far, you have created several filters and add them to your chart. Those filters are fixed by the report's creators and viewers can not change them. However, Google Data Studio provides also filters that can be controlled by viewers of the report. They are Filter control, Date range (a special type of filter control), and Data control.

As a smart investor, you might want to know the performance of your portfolio during a specific period. You can do it by adding a Date range control to your report:

  • From the top menu of the report, select Insert > Date range
  • You can select the Default date range as you prefer or let it be the Auto date range as default

You can change then the date range to see the performance of your portfolio last year, last quarter, or last month.

Select date range

Chart as a filter control

Another interesting thing about Google Data Studio is that you can use directly a chart or a table as a filter control. This feature makes your dashboard very interactive. As a smart investor, you might want to see the performance of not only your portfolio as a whole but also each individual stock. You can do it by checking the box Apply filter in the Interactions section of each chart or table that you want to use as a filter control.

Use chart as an interactive filter control

Note

To better understand the overall concept, please check out this post Create personal stock portfolio tracker with Google Sheets and Google Data Studio.

References

Disclaimer

The post is only for informational purposes and not for trading purposes or financial advice.

Comments

Popular posts from this blog

Create personal stock portfolio tracker with Google Sheets and Google Data Studio

I have been investing in the stock market for a while. I was looking for a software tool that could help me better manage my portfolio, but, could not find one that satisfied my needs. One day, I discovered that the Google Sheets application has a built-in function called GOOGLEFINANCE which fetches current or historical prices of stocks into spreadsheets. So I thought it is totally possible to build my own personal portfolio tracker with Google Sheets. I can register my transactions in a sheet and use the pivot table, built-in functions such as GOOGLEFINANCE, and Apps Script to automate the computation for daily evolutions of my portfolio as well as the current position for each stock in my portfolio. I then drew some sort of charts within the spreadsheet to have some visual ideas of my portfolio. However, I quickly found it inconvenient to have the charts overlapped the table and to switch back and forth among sheets in the spreadsheet. That's when I came to know the existence

Monitor stock portfolio with Google Sheets (Pivot table and GOOGLEFINANCE function)

As an investor, it is important to know the latest state of the stock portfolio. We need to know what stocks currently owned in the portfolio, how many shares for each one, how much dividend or gain contributed so far by each stock, etc. As we have registered stock transactions in a spreadsheet with Google Sheets, we can easily have the latest update from the stock portfolio by using pivot tables and GOOGLEFINANCE function. Use a pivot table to group transactions by symbols Configure the pivot table Positions Use GOOGLEFINANCE function to get real-time information for stocks Conditional formatting columns Demo Note References Disclaimer Use a pivot table to group transactions by symbols The pivot table helps to see relationships between data points. To see how each stock contributes to the portfolio, we will create a pivot table that originated from the Transactions sheet. Select the Transactions sheet. Select the 5 columns A:E . In the menu at the top, click Dat

Demo stock portfolio tracker with Google Sheets

As explained in the post Create personal stock portfolio tracker with Google Sheets and Google Data Studio , a personal stock portfolio tracker consists of 2 main elements: a spreadsheet in Google Sheets and an interactive dashboard in Google Data Studio. You can take a look at the sample spreadsheet below to have an idea of how the data is organized and related. It is possible to make a copy of the spreadsheet to study it thoroughly. Make a copy Note Disclaimer Make a copy Click here to make a copy Note To better understand the overall concept, please check out this post Create personal stock portfolio tracker with Google Sheets and Google Data Studio . Disclaimer The post is only for informational purposes and not for trading purposes or financial advice.