Author avatar

Deepika Singh

Building Line Charts in Power BI

Deepika Singh

  • Nov 24, 2020
  • 6 Min read
  • 1,947 Views
  • Nov 24, 2020
  • 6 Min read
  • 1,947 Views
Microsoft Power BI
Data
Business Intelligence
Data Analytics

Introduction

A line chart is a popular visualization chart used to represent a series of data points connected by a straight line. It is used to represent continuous data sets. Time series forecasting and stock market trend analysis are common applications of line charts. This guide will demonstrate how to build line charts in Power BI Desktop.

Data

In this guide, you will work with a fictitious data set of bank loan disbursal across years. The data contains 3,000 observations and 17 variables. You can download the dataset here. The major variables are described below:

  1. Date: Loan disbursal date.
  2. Income: Annual income of the applicant (in US dollars).
  3. Loan_disbursed: Loan amount (in US dollars) disbursed by the bank.
  4. Gender: Whether the applicant is female (F) or male (M).
  5. Interest_rate: Annual interest rate, in percentage, charged for the disbursed loan.

Start by loading the data.

Loading Data

Once you open Power BI Desktop, the following output is displayed.

b1

Click on Get data option and select Excel from the options.

b2

Browse to the location of the file and select it. The name of the file is BIdata.xlsx, and the sheet you will load is BIData sheet. The preview of the data is shown, and once you are satisfied that you are loading the right file, click Load.

b3

You have loaded the file, and you can save the dashboard. It is named PowerBI Visualization. The Fields pane contains the variables of the data.

b4

Adding Line Chart

The first step is to add a Line chart from the Visualizations pane.

l1

Drag the variable Date into the Axis field, and Interest_rate in the Values field.

l2

The above line chart is incorrect as it adds the interest rate values. To make the correction, right click and select Average.

lthr

The above step will produce the correct line chart that displays the average interest rate.

l4

Format Line Charts

The Format field in Power BI Desktop provides several options to format the chart. To begin, turn on the Data labels as shown below.

l5

You can see the data labels plotted in the line chart, but the text size is small. Set the Text size to twelve.

l6

You can also add new dimensions to the chart. For example, drag the Gender variable into the Legend option. This creates two line charts corresponding to gender.

l7

If you want to change the color of either of the line chart, that is also possible. Go to Data colors and you will see the default color for both gender.

l8

Click on the default color for F and several color options will be displayed.

l9

Pick the color of your choice or as shown in the chart below to generate the following output.

l10

You can also format the title of the chart. Go to the Title option under Format.

l11

Change the Font color, Alignment, and Text size of the title. This will generate the resulting output.

L12

Conclusion

Line charts are used across industries because of their power to represent changes across time. They are used for time series forecasting and in various financial reporting tasks. Another advantage is that you can represent changes in multiple variables across time. Line charts are used across sectors and knowledge of building line charts is a useful skill set to enhance your business intelligence capabilities.

To learn more about building powerful visualization in Power BI Desktop, please refer to the following guides: