Portfolio Selection and Management Using Power BI

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 37

Table of Contents

Acknowledgements...............................................................................................................................3
ABSTRACT..............................................................................................................................................4
Chapter 1: Introduction.........................................................................................................................5
1.1 Previous Research..................................................................................................................5
1.2 Limitations in Existing research..............................................................................................6
1.3 Aims and Objectives of the thesis..........................................................................................6
Chapter 2: Literature Review.................................................................................................................7
2.1 ROLE OF PORTFOLIO MANAGAMENT SYSTEMS.....................................................................7
2.2 VARIOUS APPROACHES FOR STOCK PRICE PORTFOLIO SELECTION AND MANAGEMENT......8
2.2.1 Fundamental Analysis....................................................................................................8
2.2.2 Technical Analysis..........................................................................................................9
2.3 ROLE OF BUSINESS ANALYTICS IN DATA MANAGEMENT.......................................................9
2.4 PORTFOLIO DECISION ANALYSIS..........................................................................................10
2.5 TIME SERIES FORECAST AND MODELLING...........................................................................10
2.5.1 Stock prices as time-series data...................................................................................11
Chapter 3: Data Collection...................................................................................................................11
Chapter 4: Research Methodology......................................................................................................12
4.1 PROPOSED SYSTEM..............................................................................................................12
4.2 TECHNICAL SPECIFICATIONS................................................................................................13
4.3 METHODOLOGY...................................................................................................................14
4.3.1 Setting up the environment.........................................................................................15
4.3.2 Importing data into Power BI Desktop.........................................................................16
4.3.3 Data Modelling and Writing DAX functions.................................................................19
4.3.4 Data Visualizations.......................................................................................................21
Chapter 5: Data Analysis......................................................................................................................21
Chapter 6: Results................................................................................................................................22
Chapter 7: Conclusion..........................................................................................................................23
Critical Reflection.................................................................................................................................24
APPENDICES.........................................................................................................................................25
REFERENCES........................................................................................................................................31
List of Figures
FIGURE 1 POWER BI ARCHITECTURE 10
FIGURE 2 STOCK PRICE DATA ON YAHOO FINANCE 12
FIGURE 3 GENERAL OVERVIEW OF THE PROPOSED RESEARCH METHODOLOGY (BANNER ID) 15
FIGURE 4 DATA IMPORT OPTIONS IN POWER BI DESKTOP 18
FIGURE 5 DATA IMPORTED IN POWER BI WITH DATA VALIDITY AND ERROR PERCENTAGE 18
FIGURE 6 CHANGING DATA TYPES TO REFLECT THE CORRECT TYPES OF DATA 18
FIGURE 7 CHANGED COLUMN NAMES AND REMOVED UNWANTED COLUMNS 18
FIGURE 8 RELATIONSHIP BETWEEN THE TABLES IN POWER BI DESKTOP 18
FIGURE 9 TOP COMPANIES BY EPS 19
FIGURE 10 TOP COMPANIES BY MARKET CAP 19
FIGURE 11 PORTFOLIO MANAGEMENT SYSTEM IN POWER BI 21
FIGURE 12 DATA IMPORTED IN POWER BI WITH DATA VALIDITY AND ERROR PERCENTAGE 21
FIGURE 13 TABLE 1 21
FIGURE 14 TABLE 2 21
FIGURE 15 TABLE TOP MARKET CAP 21
FIGURE 16 HIGHEST STOCK PRICE, %CHANGE AND P/E RATIO 21
FIGURE 17 TOP COMPANIES BY EPS 21
FIGURE 18 TOP COMPANIES BY MARKET CAP 21
FIGURE 19 TABLE CONTAINING STOCK INFORMATION 21
FIGURE 20 SLICER WITH STOCK PRICES 21
FIGURE 21 PORTFOLIO MANAGEMENT SYSTEM IN POWER BI 21
FIGURE 22 FILTERING RESULTS BASED ON SELECTION 21
Acknowledgements

This research has been a great learning experience to me, along with an opportunity to
demonstrate my skills and use the knowledge that I have gained from my course Course
name. It has helped me in gaining the hands on experience for the concepts that I have
studied theoretically during my course.
For this research opportunity and providing all the tools, resources, guidance and support to
me to complete this research, I would like to thank my college UNIVERSITY NAME.
Next, I would like to thank Costas full name for dedicating his time to help and guide me in
this research work. He guided me through his invaluable feedbacks and constant
suggestions on how to plan the research and complete it within the planned timeframe and
within the scope. I appreciate his willingness to take time from his schedule to provide
constructive feedbacks to me.
I would like to thank my supervisor Raja full name whose constant support, motivation,
knowledge on the subject matter and guidance helped and inspired me to complete this
research on time and within the acceptance standards of the University. His time and efforts
in providing me feedbacks on all the previous reports and drafts is much appreciated. It
would not have been possible to complete this report without his assistance.
ABSTRACT

Stock market investments have been a popular way of earning more profits but the
fluctuations in stock market make it difficult for the investors and portfolio managers to
manage their stock market investments. It is very difficult to create a portfolio in the first
place with real time data, let alone maintain one to show the updated prices and trends.
There are many different ways which have been proposed to create a portfolio management
system such as Machine learning algorithms, Azure Machine Learning services, etc. as well
as the traditional financial methodologies. Most of the tools that allow the portfolio tracking
and stock market analysis are either paid or have limitations of use. This research will focus
on analysing the patterns and perform future predictions for the trends and movements
identified in stock market and maintain a portfolio of all the invested stocks using traditional
financial methodologies and power BI. In this research, the stock price analysis and portfolio
management has been proposed using an interactive dashboard app in Microsoft Power BI
Desktop. Power BI is a relatively easy and more efficient tool to perform this research due to
its ability to forecast future trends using AI tools and large range of effective visualization
tools. Data collection process for the research included the collection of quantitative data
for the companies such as their financial statements for the last 5 years including profit loss
summary and the stock price summaries of the companies including the opening and closing
price of the stocks on a particular day. This data was cleaned and modelled in Power BI
using Data transformation, DAX operations and Data modelling algorithms. Effective
visualizations will be created using Power BI Artificial Intelligence modules and these
visualizations will be analysed to conclude the research and provide results for the research.
The resulted dashboard app will allow the users to manage their portfolio and also compare
the stock prices of various companies and make investment decisions accordingly. The
proposed system will be tested and modified to reflect higher accuracy.
Chapter 1: Introduction

1.1 Previous Research

For a long period of time, the creation, selection and management of Stock market Portfolio
Management system has remained the most interesting topic of research amongst the researchers
from the fields of computer science, Mathematics and finance all around the globe. There are a
number of existing research papers and thesis which focus on evaluating the situation of the stock
market and proposing different models for portfolio management and tracking systems using many
different technologies which include modern statistical technologies such as Machine leaning as well
as traditional financial technologies such as calculating the expected returns by using standard
deviation. The research model that gained the most popularity amongst all in this field was the one
Markowitz presented in his paper on Portfolio Selection in 1952. No other research paper has gained
this much success in this area since then. Any investment made in stock market can be assessed in
the terms of risks and returns and these returns can be maximized by working on minimizing the
given level of associated risk (Markowitz, 1952). However, many other factors and attributes need to
be assessed along with risk and returns simultaneously and these attributes can significantly affect
the decision to purchase a stock (Peykani et al., 2020). Financial summary of the companies, the rate
of investment (ROI), rate of returns, profit/loss summary, debts, rate of liquidity, etc. might be some
of these attributes amongst others.

In a paper on Investment Analysis and Portfolio management of top 10 stocks in India amid market
turmoid in COVID-19, Supriya Singh (Singh, 2018) also made use of risk and returns along with the
optimal weight of the stock to create an optimal portfolio. The effect of diversification while
performing the investment analysis was also explored in this paper.

In a research thesis by Wang and Ren (2018) on hedging theory of modern portfolio management,
linear regression and linear mean variance model is used to calculate the optimal hedge ratio in
portfolio management.

In a paper on Portfolio decision analysis: Recent developments and future prospects, Liesio, Salo &
Keisler (2020), the authors conducted a survey on 148 articles on Portfolio Decision Analysis and
found out that there is a significant improvement in the methods of solving complex problems and
the level of sophistication in case of methodology used has also increased in the last few decades.

In another paper on Optimization of multiple satisfaction levels in portfolio decision analysis, the
authors Barbati and Greco (2017) proposed an approach to help the decision maker in controlling
the choice of good evaluations that would lead to a better portfolio of projects. The research made
use of interactive multi-objective optimization and Dominance based rough set approach (DRSA) in
portfolio decision analysis. The results of the research showed higher number of projects that
attained the presented satisfaction levels.

Vijh, Chandola, Tikkiwal and Kumar (2020), in their paper on Stock Closing Price Prediction using
Machine Learning used Artificial Intelligence and Random forest techniques to predict the closing
stock price of five companies on the next day. The research demonstrated a comparative analysis
between Artificial Neural Networks (ANN) and Random Forest (RF) and concluded that ANN provides
better predictions when compared to RF.
Vaezi and Sadjadi (2019) also presented a thesis on A portfolio selection model based on the
knapsack problem under uncertainty. The thesis proposed a method to determine the number of
shares for each asset and used knapsack based portfolio selection algorithm to characterize
expected returns, prices and budgets. The proposed model proved to be maximizing the returns of
investment by associating the risks involved, budget cardinality and ceiling constraints amongst
other parameters.

Another article on Predicting stock prices using Machine Learning by Katherine Li (2022)
demonstrated the use of technical analysis and Simple MA and Exponential MA techniques to predict
stock prices and utilized Long Short Term Memory (LTSM) to build a predictive model and compare
its performance by technical analysis. The research worked on the stock price of the company Apple
and tried to predict its stock price using the proposed model.

These references show that there has been significant research in this field and also, significant
growth in the ways in which stock market predictions are done and portfolios are created and
managed. Many different approaches have been provided by the researchers to effectively predict
the stock prices and manage the stock portfolio including machine learning, artificial intelligence,
random forest, Knapsack, Long Short Term Memory (LSTM) and many more.

1.2 Limitations in Existing research


The above section has listed quite a few research papers in the field of stock market analysis and
predictions and portfolio selection and management systems. These research papers showed
significant results through their research implementations. Many different ways have been proposed
to achieve the results and answer this research question. Although these methods provided
significant results, there are still chances of improvement in all these papers.

In the research by Liesio, Salo & Keisler (2020), possibilities such as Decision Analysis (DA), decision
aid, etc. were not explored. These options could add to the understanding of mathematical structure
of human decision as well as social science of the management of human organizations. In Barbati
and Greco’s thesis (2017), the focus was more on the point of view of the decision maker and
making their experience better instead of trying to achieve more suitable results on the
management of portfolio. Markowitz’s (1957) thesis lacked the inclusion of some important
attributes such as the financial summary containing the profit/loss details, sales and purchase
details, the debts and investments by the company, rate of return, etc. Whereas, Vijh’s (2020) deep
learning model for stock prediction could have provided better results if it considered the role of
financial news and articles also along with the other financial parameters such as the traded volume,
profit and loss statements of the company, the closing price of stocks, etc. Vaezi and Sadjadi’s thesis
(2019) did not take into consideration class constraint and chance constraints and the inclusion of
risk measurement factors such as variance and Value-at-Risk (VaR). Katherine’s article on Predicting
stock prices using machine learning did not incorporate sentiment analysis on news and social media
regarding the stock market and given stock of interest. Similarly, there are other research works as
well which lacked some of the important parameters for stock price analysis and portfolio selection
and management.

The classical machine learning algorithms such as Linear Regression, Random Walk Theory, Moving
Averages, Moving Convergence/divergence, etc. along with the linear models such as Autoregressive
Moving Averages, Autoregressive Integrated Moving Averages, etc. have been presented evaluated
and explored in the previous research works for the prediction of stock prices (Vijh et al., 2020).
These technologies and algorithms proposed in these research papers used for the calculation of the
predicted stock prices and for the selection and management of portfolio are very complex. Less
research has been done in the related field using Business Analytics and intelligence solutions such
as Power BI. Most of the papers and online articles explore the use of machine learning and
advanced statistical tools to calculate the predicted stock market price.

1.3 Aims and Objectives of the thesis


This research paper will focus on working towards trying to mitigate these limitations and work on
the challenges of stock price predictions and the challenges of building an effective portfolio
management system. The proposed app in this thesis will work on a relatively easier and more
interactive platform for portfolio management. The proposed model will be made as accurate as the
other models using Machine Learning and advanced statistical tools. Many other factors apart from
the stock price values such as financial ratios of the companies will also be used in this research to
understand the profit/loss faced by the company and help the user in making effective and
profitable investment choices.

The analysis of the patterns and performing future predictions for trends and movements in the
stock market based on the current values will be the focus of this research thesis. This research will
also include the maintenance of portfolio of the invested stocks and other stocks in the market
which have the potential of providing profits using Microsoft Power BI Desktop and traditional
financial methodologies.

The main objectives of this research thesis are as follows:

 To perform literature review and study of previous research thesis, online articles and books
to identify the gaps in the related field and to understand how the Portfolio tracker can be
created and visualized using Power BI dashboards and reports.
 To analyse the stock price movements and trends of different companies and identifying and
listing the top companies with top stock prices and building the stock portfolio management
tracker using Power BI dashboard app.
 To write and build machine learning linear regression algorithms for predicting and
forecasting the future trends in stock prices using python programming language.
 To analyse the visualizations created in Power BI dashboard and conclude results by
comparing the predicted results with the actual real time data from the original data source.
 To help the users in decision making for stocks investment in companies through user-
friendly visualizations and help them manage their stock portfolio in an easy and effective
way
Chapter 2: Literature Review
In investment management, the two main fields of study are the selection of portfolio and the art of
optimizing it (Peykani et al., 2020). The investment and stocks market is very volatile and is very
difficult to predict and it is equally important to understand the trends for the investors. Accurate
stock price prediction is very challenging due to multiple factors such as political factors, global
economic conditions, unexpected events and a company’s financial performance and so on (Li,
2022). All the prediction aspects such as physical and psychological factors combine to make share
prices volatile and very difficult to predict with a high degree of accuracy (Singh, 2018). Let us first
try to understand what a stock market portfolio is and what different methodologies to create an
effective and profitable portfolio are there.

2.1 ROLE OF PORTFOLIO MANAGAMENT SYSTEMS


Portfolio refers to the allocation of wealth amongst several assets (Patel and Chawda, 2015). These
assets can be anything from cash, gold, stocks or fixed deposits. There assets can either include risk
or can be completely risk free. If the return on the investment in future is unknown and uncertain, it
is called to be a risky asset and if the return on the investment in future is known with certainty,
then it is said to be risk free asset. Stock market portfolio refers to the allocation of wealth amongst
several stocks to maximize the returns or rewards and minimize the risks (Patel and Chawda, 2015).
The decision to purchase a stock and select a portfolio of stocks can be more difficult since many
attributes such as rate of return, rate of liquidity, financial ratios, etc. must be considered
simultaneously (Peykani et al., 2020). There are two major tasks that are associated with stock
market portfolio management: first, Portfolio construction or portfolio selection where some
particular stocks are selected to invest among a large pool of available stocks along with their
proportions and second, portfolio optimization where portfolio is rebalanced continuously to reflect
changes that occur in varying financial markets (Patel and Chawda, 2015). The creation and
optimization of the stock price portfolio management systems are the two major branches of study
in investment management (Peykani et al., 2020).

It is very important to build a portfolio management system which can properly distribute the shares
amongst various assets. To propose a conservative approach to create a portfolio, it is required to
re-evaluate the qualified stocks in another phase to assign the amount of investment in each stock
after filtering the undesirable stocks and detecting the most desirable ones (Peykani et al., 2020).
One other factor to consider is that the parameters are highly uncertain in nature. The nature of the
stock market is highly volatile and is considered as non-linear. Accurate stock price prediction is
extremely challenging because of multiple (macro and micro) factors, such as politics, global
economic conditions, unexpected events, a company’s financial performance, and so on (Li, 2022).
Financial time series prediction is known to be a notoriously difficult task due to the generally
accepted, semi-strong form of market efficiency and the high level of noise (Shen and Shafiq, 2020).
Even after considering the difficulties of efficiently predicting stock prices, many papers have been
presented in the related field. All these papers proposed entirely different methods and technologies
to effectively predict stock market prices and creating and managing a portfolio based on the
predictions. Let us explore some of the ways presented by other research works which can solve this
problem of stock market portfolio selection and management.
2.2 VARIOUS APPROACHES FOR STOCK PRICE PORTFOLIO SELECTION
AND MANAGEMENT
As presented in section 1.1 and 1.2, many research works have tried to identify the solutions to the
problem of predicting stock market prices for various companies’ stocks and these papers have
further used these predictions for effectively creating or selecting a portfolio of stocks with
maximum profits. These papers also evaluate methods to manage this portfolio of stocks to guide
the investor or portfolio manager in gaining maximum profits out of their investments. In this
section, we will try to compile some of these methodologies and approaches for answering the
questions related to portfolio creation and management.

When it comes to stock predictions, there are basically two main types of analyses that can be
performed on the data for efficient stock predictions. These approaches are: fundamental analysis
and technical analysis. Both these approaches are extremely opposite to each other.

2.2.1 Fundamental Analysis


Fundamental analysis can be measured by measuring a security’s intrinsic value by studying the
economic and financial factors (Segal, 2021). It evaluates a company’s stock by examining its intrinsic
value, including but not limited to tangible assets, financial statements, management effectiveness,
strategic initiatives, and consumer behaviours; essentially all the basics of a company (Li, 2022). This
method helps in determining the real value of the stock. The real value is calculated by comparing
the current price of the security with the number determined through analysis based on various
factors. This value helps in determining if the security is over valued or under valued. If this value
comes out to be more than the market price, then the stock is considered as the buying
recommendation. The analysts who work on fundamental analysis study the effect of security’s
value from macroeconomic factors such as the state of the economy and industry conditions to
microeconomic factors like the effectiveness of the company's management (Segal, 2021). In this
analysis, the analysts first study the overall economy, the strength of the industry to which the
company belong and then make decisions on the individual performance of the company to finally
calculate the real market value of the security. Fundamental Analysis involves analyzing the
company’s future profitability on the basis of its current business environment and financial
performance (Singh, 2018). The investors who follow the analysis results from fundamental analysis
expect the recommendations to be favourable for buying the stocks and they have a higher
probability of increasing with time. The fundamental analysis can further be of two types: Qualitative
fundamental analysis and Quantitative fundamental Analysis. The quantitative analysis is done on
the information related to numbers and amounts whereas, the qualitative analysis is done on the
information related to nature or standard of something, instead of the quantity (Segal, 2021). Being
a relevant indicator for long-term investment, the fundamental analysis relies on both historical and
present data to measure revenues, assets, costs, liabilities, and so on and its value does not change
with short-term news (Li, 2022).

2.2.2 Technical Analysis


Technical analysis is a way of evaluating investments and identifying the opportunities in trading and
investments by analysing the statistical trends which are collected from trading activities such as
price movement and volume (Hayes, 2022). The technical analysis does not evaluate the security
based on the sales and earnings of the business like fundamental analysis, instead, it uses the price
and volume to study the security’s value. Technical analysis analyses measurable data from stock
market activities, such as stock prices, historical returns, and volume of historical trades; i.e.
quantitative information that could identify trading signals and capture the movement patterns of
the stock market (Li, 2022). It also used the historical and current data for comparison just like
fundamental analysis but its main focus is on the short term trading. Technical analysis forecasts the
direction of prices through an analysis of historical market data such as price and volume (Segal,
2021). The analysts who perform technical analysis believe that the future or current price or value
of the security is highly influenced by the trading activities in the past and the changes in the price of
the security. Technical Analysis, on the other hand, includes reading the charts and using statistical
figures to identify the trends in the stock market (Singh, 2018). It is often used to generate short-
term trading signals from various charting tools, but can also help improve the evaluation of a
security's strength or weakness relative to the broader market or one of its sectors (Hayes, 2022).
The technical analysis generally considers the indicators such as price trends, chart patterns, volume
and momentum, moving averages, oscillators, and support and resistance levels (Hayes, 2022).

2.3 ROLE OF BUSINESS ANALYTICS IN DATA MANAGEMENT


Business Analysis is a meticulous learning of data to bring forth real world information based on the
organization’s demand (Negi, 2021). Analytics can be viewed as the process of developing actionable
decisions or recommendations for actions based upon insights generated from historical data
(Sharda, Asamoah and Ponna, 2013). The recent advancements in Business Analytics and Big data
has provide the corporate companies to advance their services and systems as well their products to
align with the newer technologies. Over the years, the public and private sectors have seized these
opportunities to advance their products and provide more efficient solutions to their clients and
customers. The organizations are now more disputing over the decisions for managing huge datasets
bases and the ways to know their business (Negi, 2021). The major dispute is about the knowledge
of collected data, the meaning of the data, analysis and the methods of analysis and taking decisions
based on the results. Data and data analytics tools help in improving customer experience by
keeping them engaged in the business. It helps you understand who your customers are, how they
shop, what they buy, and how they prefer to engage; while also helping you to build better, more
intelligent tools to serve and retain them (Griziaux, 2021).

The advancement in technology such as Artificial Intelligence and Machine Learning has led to the
growth of analytics and data analysis technologies as well. The Business Analytics has been used by
organizations to derive valuable information from the collected big data. For a long time, businesses
have been relying on Business Intelligence (BI) to deliver insights about their businesses and analyse
their business performance. Now, these technologies have been extensively used to provide
valuable insights and significant analysis in various other fields as well. With the advancement of
technologies, cloud, and business analytics, there has also been an advancement in the emergence
and use of business intelligence tools. Through its automating power, the technology allows the
important human resources to focus on more important and complex processes and strategies.

In Power BI data analytics, the flow that is being followed for analysis is as follows:
Figure 1 Power BI Architecture

2.4 PORTFOLIO DECISION ANALYSIS


Portfolio decision analysis (PDA) refers to the theory, methods and practice which support decision
makers in making informed multiple selections from a set of alternatives with the help of
mathematical models that account for relevant constraints, preferences and uncertainties (Liesiö et
al., 2021). This definition was given by Leisio in his paper on Portfolio Decision Analysis and can
significantly differentiate PDA from its siblings and other methodologies. The portfolio creation,
management and optimization problems are two of the main fields of studies in investment
management (Peykani et al., 2020). Improved Methods for Resource Allocation provides an
extensive, up-to-date coverage of decision analytics methods which can help the firms and public
organizations in allocating resources to lumpy investment opportunities while explicitly recognizing
relevant financial and non-financial evaluation criteria and the presence of alternative investment
opportunities (Salo, Keisler and Morton, 2011). In the context of data analytics, portfolio
management problems are considered as the most important ones. In PDA, the most appropriate
modelling tool is considered to be the optimization methods. Whereas, in strategic decisions, the
problems are framed as one of the options from a short list of options. There are many problems in
PDA which makes it less efficient to be used in this research. Let’s see some of the characteristics of
PDA in detail:

1. The first and foremost constraint that need to be considered is the budget constraint or the
resources constraint. Due to the unavailability of resources, many decision opportunities can
not be considered.
2. Choosing an alternative into the portfolio is expected to produce some positive benefit
which can be tangible or intangible but it will often be multidimensional mixing both kinds of
benefits (Liesiö et al., 2021).
3. The value of selecting a portfolio varies in a systematic manner. Depending on the context,
two projects simultaneously may produce more or less value than the sum of the value of
doing both the projects individually and also, these may cost more or less than the sum of
the cost of these projects individually (Liesiö et al., 2021).
2.5 TIME SERIES FORECAST AND MODELLING
Time series is a collection of data points collected at constant time intervals which are analysed to
determine the long term trend so as to forecast the future or perform some other form of analysis
(Jain, 2020). The time series forecasting depends on time even in the case of linear regression model.
Most of the time series models have some sort of seasonality trends along with the increasing and
decreasing trends. The time series can also be stationary and any Time series can be said stationary
if its properties such as mean, variance, etc. which are the statistical properties remain constant over
time. But not all Time series are stationary and assuming that it is while developing any model is not
correct. Time series modelling involves working on time (years, days, hours, minutes) based data, to
derive hidden insights to make informed decision making (Srivastava, 2020). The time series analysis
and modelling are very powerful tools for forecasting and predictions. These models are considered
as more useful when the data available is serially correlated. Most of business houses work on time
series data to analyse sales number for the next year, website traffic, competition position and much
more (Srivastava, 2020). Some of the time series modelling techniques are stationary series, random
walk, dickey fuller tests of stationarity, rho coefficient, etc. Any time series is said to be a stationary
series if the mean of the series is a constant, the variance of the series is not a function of time and if
the covariance of the ith and i+1th terms is not a function of time.

2.5.1 Stock prices as time-series data


We have already discussed that the stock prices are highly volatile values and can not be predicted
completely at any moment of time. But despite the volatility, the stock prices are not something that
can be just randomly generated. They can be analyzed as a sequence of discrete-time data; in other
words, time-series observations taken at successive points in time, usually on a daily basis (Li, 2022).
Time series forecasting which means the prediction of current values based on past values can prove
to the best for predicting stock prices as well. There only needs to be a way to aggregate the
sequence of information due to the sequential nature of the data related to time-series. From all the
potential techniques, the most intuitive one is MA with the ability to smooth out short-term
fluctuations (Li, 2022).
Chapter 3: Data Collection

The first step in the research was to collect the data for analysis. For this purpose, we went through
many online websites and read online articles to determine which data source will be most suitable
for this research and is available easily publicly. Most of the data sources were very credible and did
not provide the latest real time updates in the stock price fluctuations. These sources could not be
used for the research because of their false data and this would make the system inefficient. I found
three different online sources which could be used for this research which were Reuters, Money
Control and Yahoo Finance. Out of these three options, I went with Yahoo Finance. I found Yahoo
Finance as the most credible free source for the data collection for this research. The data on Yahoo
Finance is updated every second and shows the exact price of stocks at a given time on the stock
market which is what was required for this research. The website provided us with the dynamic data
required for this analysis so that when the data on the website changes, the same will be reflected in
our dashboard as well. Below is an example of sample stock data present on Yahoo Finance:

Figure 2 Stock price data on Yahoo Finance

The data on Yahoo Finance is live data and is changing every second. Since the focus of this research
was on developing a power BI dashboard which can most accurately analyse the stock data and
present predicted results, we only worked on the fetched set of data to train the Power BI
dashboard to work more accurately and then predicted the stock price for these companies using
the trained model.

The initial data from Yahoo Finance contained columns and fields such as the Name of the company,
last price, market time, change, %change, volume, market cap, intraday high/low, 52 week range
and day chart. It was not possible to import this data into Microsoft Power BI in the current format
because some the columns contained graphs and spark lines. This data would not meet the data
validation criteria in Microsoft Power BI and additional columns needed to be removed. Therefore,
while importing this data into, some of the columns were got rid of.
When this data was imported into Power BI, the columns that were kept and imported were
company name, change, %change, last price, EPS, 52 week high, 52 week low, Market cap and serial
number. The columns such as intraday high/low, day chart, market time and 52 week range were
discarded and instead, 52 week high, 52 week low, serial number, EPS, etc. were added to make the
data more credible and suitable for analysis.

Since it was not possible to copy and clean this data in MS-Excel because that would make the data
static and there was no way to keep the data continuously updated in Excel and clean it. Similarly, if
we store this data in any Structured Query Language (SQL) based Database also, it would not allow
us to work on dynamic data which will get refreshed after every second. To avoid this issue, some
method was required by which the data can get refreshed with changing values on the internet
dynamically. Therefore, the best way was to import the data directly into Power BI and clean it in
Power BI itself during the data validation step. For this, the data was imported into Power BI and the
columns were renamed and removed as per the requirements. Once the data was ready, the next
steps of data modelling and visualization were performed.
Chapter 4: Research Methodology
4.1 PROPOSED SYSTEM
Over the years, researchers have focused on the analysis of issues and problems related to stock
price along with the efforts to analyse the transactions in stock market such as volume burst risks,
which has made the research domain for stock analyses even broader and is a proof that the area
still has high research potential (Shen and Shafiq, 2020). With the advancements in Artificial
Intelligence and Machine Learning algorithms, new technologies and tools were used to propose
models which could be used a training model for efficiently predicting stock prices of the companies
by combining AI and ML together. These models prove to be success and can provide stock market
predictions with higher accuracy than other techniques. Moreover, these technologies are also
relatively easier to explore and are still growing, which means that there is a chance of building an
even more efficient system for portfolio selection and management. But in this research, we will
deviate from these technologies and use even more simple technologies such as Power BI, MS Excel
and Python programming language to do the same task as is being done by these more advanced
technologies. Even though Power BI is much simpler than these advanced technologies and
algorithms, it can prove to be as efficient in portfolio selection and management as any other
technologies.

In this research, the focus of the research is to propose and build a stock price prediction model
using Power BI and Python programming language. Power BI is a visualization tool which is perfect to
generate meaningful insights and beautiful dashboard from raw and messy data. Power BI also has
the potential to make future forecasts and predictions using its in-built Artificial Intelligence
modules. Since the stock market data is volatile and can be very unpredictable and messier at times,
Power BI can prove to be very useful and successful in harnessing this data and turning it into
meaningful insights and predictions using its Artificial Intelligence modules. Microsoft Power BI is
recognised as a leader in Gartner’s 2020 Magic Quadrant for Analytics and Business Intelligence
Platforms (Sin, 2020). Python, on the other hand, provides the advantage of machine learning
algorithms which can be very easily implemented using python code in a very simple manner.
Combining these two technologies can providing a system which can be as efficient as any other
model built with the combination of Artificial Intelligence and Machine Learning.

The following diagram demonstrates a rough idea of the steps and the research methodology
incorporated in this research.
Figure 3 General overview of the proposed research methodology (Banner ID)

As demonstrated in the figure above, the data was fetched from online sources and imported into
Power BI for analysis. The data was first cleaned in Microsoft Power BI and then DAX functions and
data transformations were used to transform this data into more valuable and meaningful insights.
Then using this data, user friendly visualizations were created for easy and better understanding of
the user.

The proposed stock market price prediction app in this research contains various sections and graphs
to represent various types of analysis performed on the data. The app contains a list of the top 10,
top 20 and top 30 stocks at the moment which have the highest profit ratio a compared to their
original prices. The app contains a scrolling bar at the top which provides the current real-time price
of the stocks for all the companies along with its predicted price at the closing time at the end of the
day for current day. It also provides visualization and information for the top stocks on the basis of
differentiation of the stocks by EPS, highest profit ratio, top companies by market cap, highest stock
price, highest positive change ratio, and highest P/E ratio. There is a search option where all the
company names are provided to filter out the details for that company and retrieve information for
only the selected companies. These selected companies can be one or more. If no filtering is done,
then all the companies are shown on the dashboard. There is a table at the bottom of the dashboard
which contains information about all the companies which are a part of this dashboard. It contains
information such as the company name, the last stock price of the company, the change percentage
for the last stock price to the current stock price, market cap in crores, EPS information, the 52 week
high and 52 week low for the stock price of the company. This table can be used to create a portfolio
of stocks based on the highest stock prices and highest positive change percentage. Once the
portfolio is created, the search option can be used to only filter out the table to show the stocks of
only the selected companies which will contain the companies present in the portfolio only.
The data is imported from an online source from Yahoo Finance website. The data source for this
data is the online website only. This gives a huge advantage to the app by providing and fetching the
real time data from the online source and updating the dashboard accordingly with real time prices
of the stocks for given companies. By refreshing the dashboard, it can update the app with latest
real-time information. This will allow the users to keep an eye on the latest price of their stocks and
maintain their portfolio with stocks with highest and positive profit ratios. The app is very easy to
use for the user as well.

This thesis makes use of and implements the business analytics and forecasting methods using
Microsoft Power BI to analyse the data fetched from a stock price website. The features, usability
and benefits of the proposed system includes the following:

 Fetching real time data from reputable online sources such as Yahoo Finance.
 Loading and displaying the data in the form of visualizations and tables to provide insights
which can prove to be profitable to the user using Microsoft Power BI platform.
 Obtaining meaningful insights on the stock price prediction and displaying the current and
latest data on the dashboard
 Using advanced business analytics and business intelligence technologies such as Artificial
Intelligence and Machine Learning by integrating them with advanced analytics tools such as
Microsoft Power BI and python programming language.
 Improving the stock price predictions through the use of advanced tools and technologies
 Allowing the user to select and create a portfolio of companies with highest profits in the
stock prices
 Allowing the users such as stock investors or portfolio managers to manage their portfolio of
stocks using an easy and efficient user interface

4.2 TECHNICAL SPECIFICATIONS


As already suggested, the proposed system will make use of advanced Business Intelligence tools
and technologies. Microsoft Power BI is one such technology which is very prevalent these days for
advanced analytics due to its easy to use interface and high efficiency. Microsoft Power BI is the
name given to an assortment of cloud-based applications and services that can help the
organizations to collate, manage, and analyze its data from a variety of sources, through a user-
friendly interface (Wright, 2022). Microsoft Power BI pulls raw data, processes it using its analytics
modules and turns it into meaningful insights and visualizations in the form of charts and graphs
which are very compelling and easy to understand by the user. For worksheets and dashboard
visualizations, Power BI helps in building dashboards which help in providing actionable insights for
the company which can be understood and explained more easily (Matthias and Managwu, 2021).
We could also use other similar platforms such as Tableau, but Power BI was chosen because of its
easy to use and easy to understand functionalities.

Python, on the other hand, is a very powerful and most widely used programming language now a
days. It is an object oriented programming language which is used in almost every field from
robotics, to software development to business analytics and analysis. We will use python to exploit
its capabilities to implement machine learning algorithms in this research.

The table given below consists of the technologies used in this research along with their technical
specifications and latest versions which are used in this research:
Table 1 Technology stack and specifications

Name of the applications Version Installation dependency


Microsoft Power BI Desktop 2.107.841.0 SQL Server 2019, Windows 10,
64-bit processors
Python 3.10.6 NA
IDE for Python (PySpark) 3.3.0 NA
Operating System Windows 10 NA
SQL server management 18.12.1 Windows 10 or greater, SQL
studio server native client
SQL server 2019 NA

4.3 METHODOLOGY
This research was intended to work on the stock data as well as the financial statements of various
companies, therefore, quantitative data such as the financial summaries for the last 5 years to
calculate and analyse the profit and loss and stock price summary was collected including the
opening and closing price of stocks. Similar research analyses have been presented by many other
researchers in the past using many different methodologies such as machine learning algorithms,
azure cloud, etc. Most of these technologies and tools allow stock price analysis effectively and help
in portfolio tracking also but they are either paid or have limitations (Kapadia, 2018). Power BI
Desktop was used to create a dashboard to analyse the profit/loss summary of the companies and
perform the stock market analysis. Microsoft Power BI is a relatively easier and more convenient and
effective tools to perform this research due to its ability of forecasting future trends using its AI
modules and larger range of effective visualization tools. Microsoft Power BI is recognized as a
leader in Gartner’s 2020 Magic Quadrant for Analytics and Business Intelligence Platforms
(ChangYueSin, 2020). The data was collected from online source named Yahoo Finance for analysis.
This data included the financial statements of the company to know if the business is facing profit or
loss, top 10 stocks market capitalization, the opening and closing stock prices for companies in the
past few months, EPS information and the real time price of the stocks for various companies.

The initial thought was to store this data into MS-Excel first and then cleaning it before importing it
into Power BI. But this would not allow us to analyse the data in real time. The data stored in MS-
Excel would be old data and analysis would be done on this old data which would not be as efficient
as working with the real time data fetched directly from the online sources. Hence, the data was
directly imported from Yahoo Finance into Power BI, providing the advantage of working with real
time data instead of storing it in secondary sources which would not give the benefit of analysing the
real time data. The final predicted results by the dashboard app were compared with the actual
stock price of the companies for a particular day with the original online source of the data Yahoo
Finance, to test the credibility and efficiency of the presented model.

The Power BI Desktop application helped in creating a dashboard app which was highly interactive
and user-friendly as well as highly efficient and predicted all the correct results. Due to effective
visualizations, it became very easy to analyse the stock movements and see which stock is doing
better and can be profitable. This makes it easier for the investors and portfolio managers in making
investment decisions and invest in the top companies. The easy analysis of the profit and loss in the
stock market and the ups and downs in the stock prices will help the user in determining which stock
to invest in. For future work in continuation to this research, the profitability and market analysis
along with the growth analysis of the companies can also be performed using the financial
statements for the companies.

The following sections explain the steps used in the implementation of this research in a more
detailed manner:

4.3.1 Setting up the environment


As mentioned in the above sections, the research used many tools and technologies to implement
the business Intelligence and data analytics techniques. The first step in the implementation of the
research was to setup an environment for implementation of the research. This included
downloading and installing the tools such as Microsoft Power BI, python, PySpark and other tools
mentioned in the table 3.1. First of all, Microsoft Power BI desktop was downloaded on the local
computer containing windows 10 from the official website of Microsoft:
https://powerbi.microsoft.com/en-us/pricing/

Power BI Desktop free version can be downloaded from this website. After downloading the tool, it
was installed on the desktop and was ready to now create dashboards and visualizations.

Next step was to install Python. Downloading python consists of three main steps: download python
and install binaries, run the installer and add python to PATH variables in environment variables.
Python binaries were downloaded from the official Python website:

https://www.python.org/downloads/windows/

The latest version 3.10.6 was downloaded from this website. After it was downloaded, the python
installer was run. Customized installation was selected for this step. Under the advanced options,
the checkbox for Add python to environment variables was selected. After the installation
completed, the next step was to add the python to PATH environment variables. After doing this, we
verified the python installer by running the python command in the command prompt.

The final step was to download and install an Integrated Development Environment (IDE) for writing
and running the python code to test before writing it in the Power BI. Pyspark was downloaded from
the official Anaconda Website: https://www.anaconda.com/. After successful download, it was
installed on the local desktop and after installation, all the environment variables were setup and all
the required libraries were installed in the IDE.

After all the environment was setup, we were ready to move ahead with the data source selection
and setting up the data source in Power BI desktop.

4.3.2 Importing data into Power BI Desktop


To import the data collected from Yahoo Finance into Power BI desktop, the following steps were
followed:

1. Launch Power BI desktop on the computer. Click on Get Data on the Home tab. This contains
a list of all the possible options to import data from into power BI application. The list
contains options such as MS-Excel, SQL Server, Text/CSV, Web, Blank query, etc. We selected
the web data source from this option. Paste the URL for Yahoo Finance in the dialogue box
that opens. Click on next and the data will be imported into the power BI desktop from the
online source, that is, Yahoo Finance. The website URL used for this step is:
https://finance.yahoo.com/trending-tickers
2. The data was loaded into the power BI. After this, click on the table format to import the
data in tabular manner. This feature of power BI is very strong as it automatically converts
the web data or any kind of data into tabular format without having to do complex scrapping
or data transformation operations on the given data set.

The following screenshot displays all the options that are available in Power BI Desktop to
import data from various sources:

Figure 4 Data Import options in Power BI Desktop

3. The next step is to apply transformations on it to remove any errors or null values and to
apply correct data types for the given columns. The imported data looked like the figure 3.4
below. The accuracy of the data is displayed as the validity, whereas any errors in the data is
displayed as the error percentage and null value percentage. For this data, most of the rows
were error free and did not have null values. Therefore, there was not much to be done at
this stage.
Figure 5 Data imported in Power BI with Data Validity and error percentage

4. The next step was to assign the correct data type to the columns. Sometimes, while
importing the data from external sources into Power BI, there are data type mismatch
issues. This is mainly because external sources such as MS-Excel or web sources do not
provide a very wide range of data types. The limited data types are, therefore, merged into
categories. Whereas, when we import this data into Power BI, we need to first segregate the
data into their correct respective data types to before starting to work on it. If this step is
not performed, the data will not have correct data types and later, we will face issues while
applying transformation operations or DAX functions to the data. Therefore, in this step, we
assigned correct data types to all the columns present in the data.

Figure 6 Changing data types to reflect the correct types of data


5. The final step for importing the data is to rename the columns to provide more user-friendly
names if we want. Sometimes, for the externally imported data, the column names in the
source data are too technical or complex for normal people who do not have any technical
knowledge. In such cases, we should provide more user-friendly names for the columns for
easy understanding at this stage of the import process. Figure 3.6 highlights the column
names we will use for this data and these will be reflected in the created dashboard as well.
Also, we can remove any unwanted columns from the data in this step to avoid having
unwanted columns in the final app which makes the app unnecessarily complex. The data
that we selected was luckily already clean and not much was needed to be done. The data
was already filtered and we required all the columns that were present in the data for
analysis. Only three extra columns were present in the data which were not required and
contained empty values, so I removed those columns before proceeding to the next step.

Figure 7 Changed Column names and removed unwanted columns

4.3.3 Data Modelling and Writing DAX functions


As seen in the above steps, the data has been successfully imported into the Power BI app. The next
steps will be to apply functions and transformation operations and visualizations to this data to
present it in the form of graphs and charts to make it more presentable. Also, to make predictions
based on current trends will be a part of the implementation in this research. The overview of the
next pending steps is as follows:

1. The next step after importing the data into Power BI will be the data modelling. Data
modelling includes making relationships between data objects, determining cardinalities like
1 to many, many to many, 1 to 1, etc. (Microsoft Power BI Community, 2021). Data
modelling makes sure that the results obtained are correct by ensuring that the data upon
which the analysis is done is correct and has the correct format. The relationship between
columns should be correctly specified. In this step, we analysed the data and checked if
there was a need of any additional columns or table in the data to complete the
relationships and predict correct results. For this research, we had three main tables that we
worked with. The first table contained the company name, change percentage, 52 week
high, 52 week low, last price of the stock and the market cap. The second table contained
fields such as change, change percentage, company name, EPS, last price of the stock and
serial number. The third table called Top Market Cap contained fields such as Rank EPS, Rank
market cap, selected top n EPS, selected top n companies, Top N, Top values, Total EPS and
Total Market cap. The relationship between these tables is shown in the below figure:

Figure 8 Relationship between the tables in Power BI Desktop

2. In the next step, we will start writing the transformation operations and DAX functions for
the data. Data Analysis Expression is a collection of functions, operators, and constants that
can be used in a formula, or expression, to perform advanced calculations and queries on
data in related tables and columns in tabular data models (Microsoft, 2021). Writing DAX
functions is one of the difficult tasks in Power BI. The DAX functions should be correct and
should provide correct and expected output. If the functions are not properly written, we
may end up getting different, unwanted and even wrong results and outputs. Power BI
comes with its own set of Data Analysis Expression (DAX). The results of these DAX
expressions or functions can change or have a significant impact on the context or
explanation of the data. These DAX functions have the similar syntax as that of Excel
functions so that they are easy to write and follow and can be easily understood by anyone
who sees it. The general DAX formulas are simple mathematical expressions written to
derive suitable results. We first analysed the data to conclude which columns can be used
for predictions and which columns contain the possible data trends. Some of the DAX
functions that we wrote for this research are as follows:

change% = sum('Table 1'[% Chg])/100


EPS = Sum('Table 1 (2)'[EPS])

Market Cap = sum('Table 1'[Market Cap(Rs. cr)])

P/E Ratio = 'Key measures'[Market Cap]/'Key measures'[EPS]


The first DAX operation helped us in calculating the change percentage for the change in
stock price over time. Next DAX function helped in calculating the sum of EPS for the stocks.
The next one was written to calculate the sum of Market Cap for all the values in table 1.
This value was calculated in Crores rupees. The last DAX operation was written to calculate
the P/E ratio which was calculated by dividing the market cap calculated in above step by
the EPS calculated in the previous step.

4.3.4 Data Visualizations

Once the DAX operations were performed, it was time to display our results in the form of
graphs and charts. So, the next step was to create visualizations. The visualizations needed
to be simple and user-friendly and expressive. The visualizations such as graphs and charts
should be selected in such a way that it explains what is happening in the data accurately.
So, the selection of right kind of graphs and charts is very important. The colour theme also
needs to be accurate and should not be too bright or too dull. It should make the dashboard
look impressive and expressive. This is the easiest step while creating a power BI dashboard
in terms of implementation. However, it can be the most difficult part in terms of making the
dashboard expressive and user friendly. The user experience with the dashboard matters a
lot and needs special focus when working on it. Data Visualizations help in making the
analysis of data easy by anyone who looks at it and providing important insights related to
the data by demonstrating the data trends using graphs and charts. In our dashboard app,
the data visualizations used were Artificial intelligence (AI) driven. These AI driven visuals are
automatically provided in the Power BI desktop. One only needs to drag and drop the
visualization they want to use in their apps.

Since the stock market data is volatile, difficult to interpret and understand, we used simple
and very basic visualizations for our dashboard to make it easy to understand on the first go.

Final step was the portfolio creation and management. Before going for the portfolio
creation, we first tested the accuracy of our power BI dashboard app. For this purpose, we
compared the results predicted by our app with the actual stock price for those stocks on
the closing of that day. After checking the accuracy and improving it to predict the most
accurate prices, we moved ahead to create the portfolio. To create the portfolio, we studied
the predicted results and see which stocks are doing the best in the market and are
predicted to close at the highest values for the day. Also, we analysed the financial
statements also and the financial summary for these top performing stocks and filter out the
even best options to invest in.

The final app which was created using Power provided 90% accurate results to us with 10%
error margins due to the volatile nature of the stock market. This app will be user friendly
and will help the users to create the portfolio with the best options to invest in and manage
that portfolio. Currently, the application is working only with the real time data for stock
prices of various companies and providing predictions for the change in the stock price of
these companies based on the current trends.
Chapter 5: Data Analysis and Results
After all the analysis and formatting of the dashboard, we were presented with an application which
could provide us with the current real time stock price values of various companies. The dashboard
was now ready for the analysis and testing the accuracy of the dashboard by comparing the
predicted stock price with actual stock price from the online sources such as Yahoo Finance. Data
analysis for the research was done using Power BI dashboard that was created during the
implementation process. The dashboard provided enough information to analyse and derive results
from the analysis. Let’s have a quick analysis of the results and see what our dashboard presented.

The dashboard was named as Portfolio Management System. The dashboard contained two graphs
depicting the top 10, top 20 and top 30 stock prices according to their profits by EPS and by Market
Cap. At the time of creation, the top 10 companies by Market Cap were recorded to be Reliance,
TCS, HDFC Bank, Infosys, HUL, ICICI Bank, SBI, HDFC, Bajaj Finance and LIC India. The top 10
companies by EPS, however, were Info Edge, Shree cements, Page Industries, Ultra Tech, Nestle,
Bajaj, Hindustan Aeron, Bajaj Holdings, L&T Infotech and Maruti Suzuki. The highest stock price was
calculated to be of Page Industries which was 49,800. Highest positive change percentage in the
stock prices was calculated to be of Hindalco which was 4.41% and the highest PE ratio was
11,894.40 which belonged to TCS.

Figure 9 Top Companies by EPS

Figure 10 Top companies by Market Cap


The slicer at the top right corner of the dashboard depicted the current and estimated stock price of
the companies in descending order, meaning that the stock price with highest value was depicted
first, followed by other stocks in descending order. This slicer has values scrolling on the bar, which
makes it easily visible to the user. The table at the end of the report demonstrated the company
name and corresponding values such as last price of the stocks, change percentage, market cap in
crore rupees, EPS, 52 week high and 52 week low price of the stocks. For example, if we talk about
Page Industries, which had the highest stock price at the moment, the last price of the stock was
48,221.50, the change percentage was -0.75%, market cap was 53,785.65, EPS was 481.03, the last
52 week high price was 49,800 and 52 week low price was 29,965.50. If we look at these numbers,
the change percentage shows a negative change for the company which means that the stock price
was decreasing at a rate of 0.75, which means that the investor can be in loss if he/she continues to
invest in these stocks. Despite having the highest stock price at the moment, the stock for the
company was in loss.

When we matched this data with the data from Yahoo Finance, the results matched for all the
values, showing that the results calculated by our dashboard were correct and the system is reliable.
This kind of analysis can be done using our Portfolio Management System app using Power BI.

The research proposed and built a dashboard app to effectively and efficiently predict stock prices of
various companies and select and manage a portfolio of these stocks. Stock market prediction is very
difficult and many different approaches have been presented by various researchers in this field.
Some techniques based on neural networks such as Artificial Neural Network (ANN), Convolutional
Neural Network (CNN), Recurrent Neural Network (RNN) and deep neural networks like Long Short
Term Memory (LSTM) also have shown promising results (Vijh et al., 2020). An interactive Portfolio
Management System was created as a part of this research using Microsoft Power BI and Python
programming language. The project used advanced data analysis tools using Power BI and Python to
solve the problem of stock portfolio management. The stock data was collected from online sources
to be imported into Power BI and perform analysis on it. The results came out to be highly
acceptable and efficient. The built app could predict the stock price with 90% accuracy which is equal
to the results presented by other similar research papers using the complex technologies and
algorithms for same purpose.

The results also demonstrated that Power BI can be an effective tool for building portfolio
management systems and can provide significant results which can help the investors despite the
volatility and fluctuations in the market. The dashboard design was extremely simple and user
friendly. It contained all the fields and sections which can be useful to the users. The dashboard is
easy to understand and operate. The project also validated the use and importance of the using
Power BI in performing data analysis and analytics for any business.

Some of the results from the implementation are shown in the figures below:
Figure 11 Portfolio Management System in Power BI

This research thesis can also be used a guide on how to use advanced business intelligence and data
analytics tools such as Power BI to select and manage a portfolio of stocks by anyone who is working
on similar research topics. The research thesis provided a detailed set of steps which can be
performed to design an effective stock market analysis dashboard and portfolio management system
using Power BI.

Due to the lack of time and other constraints, the research could only implement the stock price
analysis of the stocks and predict future price of the stocks using limited information only. As
described in the literature review section, there are many factors that impact the fluctuations in a
stock price. These include the financial summary of the company as well. The initial plan was to
incorporate the financial analysis in this research as well. However, due to time constraints, that part
could not be implemented in this research. Future work for this research or continuation of this
research can include that part and perform the financial analysis of the company and include the
financial summary in this analysis report as well.
Chapter 7: Conclusion

Accurate stock price prediction is extremely challenging because of multiple (macro and micro)
factors, such as politics, global economic conditions, unexpected events, a company’s financial
performance, and so on (Li, 2022). The stock market was predicted to be volatile at the beginning of
2022 with a rise in inflation. All the prediction aspects such as physical and psychological factors
combine to make share prices volatile and very difficult to predict with a high degree of accuracy
(Singh, 2018). As the market fluctuates, investors need visibility into how their portfolios are
performing (Visualize portfolio performance and risk with Microsoft Power BI, 2022).

This research focuses on providing best stock marketing solutions to anyone who wants to invest in
stock market or compare the movements in one stock with other popular stocks. Analyzing stock
price movements in real time can significantly help the users in decision making about their
investments. This research focuses on analysing the patterns and trends in stock price fluctuations of
various companies’ stocks and perform future predictions for the trends and movements identified
in stock market and maintain a portfolio of all the invested stocks using traditional financial
methodologies and power BI.
Critical Reflection

The research thesis focused on topics like Data Analytics, Business Intelligence, Portfolio
management systems, stock market analysis, etc. I gained a lot of perspective on these topics while
implementing this research and writing this thesis paper. Stock market data is highly volatile and
performing this analysis on such a data was very difficult as well as a learning opportunity for me.
These topics were taught in the coursework and the learnings from there helped me a lot in this
research. I got to practice the things that had learnt practically on new tools such as Microsoft Power
BI. Through this research, I got more perspective on how these advanced business intelligence tools
can be used to create and manage a portfolio of stocks. I had already learnt and used tableau before
and had some knowledge on the implementation of the tool for data analysis. For this research,
therefore, I decided to explore Microsoft Power BI, which was comparatively easier to use and gave
the same analysis opportunities and results.

The topic selection was one of the difficult and confusing tasks for me. I had the liberty to choose
from a lot of topics related to the analysis which could be performed using Microsoft Power BI. I
went through a lot of previous research work and literature and decided to move forward with the
topic of portfolio management system. I found out that many different approaches were proposed
by the researchers in their thesis and research papers to solve the problem of maintaining a complex
portfolio management systems. This motivated me even more to try and find out an easy and
equally efficient solution to this problem. For this research, I went through the concepts related to
this topic that I had learnt in my coursework once again and tried to accumulate as much knowledge
as possible through online sources and books. Through this research, I aimed to learn more on how
to implement logics using Power BI and also, my previous knowledge of data analysis tools such as
tableau helped me in understanding Power BI more quickly.

This research also provided me the opportunity to learn how to write a thesis paper. From creating
the specification form to completing the final interim report for the research, it was a great learning
experience for me. I learnt how to frame a research question based on the problem that we are
working on. I learnt how to write an effective and concise abstract for the research, how to decide
the aims and objectives of our research and how to justify the work that we are doing. Along with
the implementation, the report writing part is also equally important. The work being performed is
of no worth if one does not know how to explain and present it properly to others. Therefore,
writing an effective research thesis was equally important for this research. It also taught me to
effectively prepare a research plan and follow it rigorously to complete the research on time.

The implementation part of the research was also very educative and knowledgeable. I learnt a lot
about stock market and learnt how to handle and keep control on volatile and continuously changing
data in a large amount. Stock market analysis and portfolio management are also very sensitive
topics and require lesser error margins because any wrong analysis and prediction can lead to big
losses to the clients or the users using the application. I learnt about the situational damages in case
of failures of the system and tried to mitigate as many issues as I could in this research. I also
encountered many issues and problems while working on this research and learnt how to handle the
issues and mitigate the problems through this research.
APPENDICES

1. Import data into Power BI Desktop

Figure 12 Data imported in Power BI with Data Validity and error percentage

2. Table 1 in Power BI
Figure 13 Table 1

3. Table 2 in power BI
Figure 14 Table 2

4. Top market cap table

Figure 15 Table Top Market Cap

5. Highest values based on various parameters


Figure 16 Highest Stock price, %change and P/E ratio

6. Top companies by EPS

Figure 17 Top companies by EPS

7. Top companies my Market cap

Figure 18 Top companies by market cap

8. Table in Power BI Dashboard containing all the required information about the stocks.

Figure 19 Table containing stock information


9. Slicer containing the current and predicted price for all the stocks

Figure 20 Slicer with stock prices

10. Portfolio Management System app in Power BI

Figure 21 Portfolio Management system in Power BI

11. Displaying results in the table based on the selected company. For example, in the below
screenshot, the selection filtered the results for Adani Green company.
Figure 22 Filtering results based on selection
REFERENCES

Barbati, M., Greco, S., Kadziński, M. and Słowiński, R. (2018) Optimization of multiple satisfaction
levels in portfolio decision analysis. Omega. Vol.78, pp.192-204.

DAX overview - DAX. (2021) [Online]. Docs.microsoft.com. Available:


https://docs.microsoft.com/en-us/dax/dax-overview [Accessed 21 Jul 2022].

Griziaux, S. (2021) Using Data & Data Analytics To Improve Customer Experience [Online].


Twilio.com. Available: https://www.twilio.com/learn/contact-center/using-data-and-data-
analytics-to-improve-customer-experience [Accessed 21 Jul 2022].

Hayes, A. (2022) What Is Technical Analysis? [Online]. Investopedia. Available:


https://www.investopedia.com/terms/t/technicalanalysis.asp [Accessed 2 Aug 2022].

Hu, W., Xie, H., Nakas, M., Shi, W. and Wang, M. (2022) Power BI for Impacts Analysis on Cost of
Living Caused by Industry Prevalence in Smart Cities [Online]. Ieeexplore.ieee.org. Available:
https://ieeexplore.ieee.org/document/8906533 [Accessed 17 Aug 2022].

Jain, A. (2020) Time Series Forecasting In Python | R [Online]. Analytics Vidhya. Available:


https://www.analyticsvidhya.com/blog/2016/02/time-series-forecasting-codes-python/?
utm_source=blog&utm_medium=stockmarketpredictionarticle [Accessed 5 Aug 2022].

Kapadia, S. (2018). How to use Power BI for Stock Market Analysis? [online] Money Excel - Personal
Finance Blog. Available at: https://moneyexcel.com/use-power-bi-stock-market-analysis/ [Accessed
25 Jul. 2022].

Liesiö, J., Salo, A., Keisler, J.M. and Morton, A. (2021). Portfolio decision analysis: Recent
developments and future prospects. European Journal of Operational Research, 293(3), pp.811–825.
doi:10.1016/j.ejor.2020.12.015.

Li, K. (2022). Predicting Stock Prices Using Machine Learning. [online] neptune blog. Available at:
https://neptune.ai/blog/predicting-stock-prices-using-machine-learning [Accessed 21 Jul. 2022].

Negi, A. (2021). Profundity Of Business Analytics & it’s Purview In India. International Journal of
Research and Analytical Reviews (IJRAR), [online] 08(04). Available at:
https://www.ijrar.org/papers/IJRAR21D1003.pdf [Accessed 24 Jul. 2022].

Patel, J. and Chawda, B. (2015) Stock Market Portfolio Management: A Walk-


through. International Journal on Recent and Innovation Trends in Computing and
Communication. Vol.3 (6).

Peykani, P., Mohammadi, E., Jabbarzadeh, A., Rostamy-Malkhalifeh, M. and Pishvaee, M.S. (2020).
A novel two-phase robust portfolio selection and optimization approach under uncertainty: A
case study of Tehran stock exchange. PLOS ONE, 15(10), p.e0239810.
doi:10.1371/journal.pone.0239810.

Salo, A., Keisler, J. and Morton, A. (2011) Portfolio Decision Analysis: Improved Methods for
Resource Allocation [Online]. University of Strathclyde. Available:
https://pureportal.strath.ac.uk/en/publications/portfolio-decision-analysis-improved-methods-
for-resource-allocat [Accessed 11 Aug 2022].

Segal, T. (2021) What Is Fundamental Analysis? [Online]. Investopedia. Available:


https://www.investopedia.com/terms/f/fundamentalanalysis.asp#:~:text=Fundamental
%20analysis%20(FA)%20is%20a,related%20economic%20and%20financial%20factors.&text=The
%20end%20goal%20is%20to,security%20is%20undervalued%20or%20overvalued. [Accessed 1
Aug 2022].

Sharda, R., Asamoah, D. and Ponna, N. (2013). Business analytics: Research and teaching
perspectives. Information Technology Interfaces (ITI), Proceedings of the ITI 2013, [online] 35.
doi:10.2498/iti.2013.0589.

Singh, A. (2018). Stock Prices Prediction Using Machine Learning and Deep Learning Techniques (with
Python codes). [online] Analytics Vidhya. Available at:
https://www.analyticsvidhya.com/blog/2018/10/predicting-stock-price-machine-learningnd-deep-
learning-techniques-python/ [Accessed 21 Jul. 2022].

Shen, J. and Shafiq, M. (2020) Short-term stock market price trend prediction using a
comprehensive deep learning system. Journal of Big Data. Vol.7 (1).

Sin, C. (2020) How to Use Power BI for Stock Market Analysis - The Babylonians [Online]. The
Babylonians. Available: https://www.theancientbabylonians.com/how-to-use-power-bi-for-stock-
market-analysis/. [Accessed 3 Aug 2022].

Srivastava, T. (2020) Time Series Analysis | Time Series Modeling In R [Online]. Analytics Vidhya.
Available: https://www.analyticsvidhya.com/blog/2015/12/complete-tutorial-time-series-
modeling/?utm_source=blog&utm_medium=stockmarketpredictionarticle [Accessed 4 Aug 2022].

Vaezi, F., Sadjadi, S. and Makui, A. (2019) A portfolio selection model based on the knapsack
problem under uncertainty. PLOS ONE. Vol.14 (5), p.e0213652.

Vijh, M., Chandola, D., Tikkiwal, V. and Kumar, A. (2020) Stock Closing Price Prediction using
Machine Learning Techniques. Procedia Computer Science. Vol.167, pp.599-606.

Visualize portfolio performance and risk with Microsoft Power BI. (2022). Bloomberg Professional
Services. [online] 22 Apr. Available at: https://www.bloomberg.com/professional/blog/visualize-
portfolio-performance-and-risk-with-microsoft-power-bi/ [Accessed 22 Jul. 2022].

You might also like