Power BI Line Chart

Do you want to know how to create a line chart in Power BI? In this Power BI tutorial, we will see What a line chart is and how to create a line chart in Power BI Desktop.

Here, we will cover the topics below:

  • What is a line chart in Power BI Desktop?
  • How to create a line chart in Power BI Desktop
  • Power BI line chart with multiple lines
  • Power BI line chart multiple values and legend
  • Power BI line chart secondary y-axis

What is a line chart in Power BI Desktop?

A line chart in Power BI represents a sequence of data points connected by straight lines, typically plotted against an x-axis and a y-axis.

It can display one or multiple lines, each representing continuous datasets. Line charts are employed to display trends or changes in details over time, as well as comparisons between two datasets.

When to use line chart in Power BI Desktop.

The line chart is best fit for this scenario:

  • Ideal for illustrating trends and changes in data over time.
  • Useful for comparing multiple data series simultaneously.
  • It helps identify patterns and anomalies in data.
  • Well-suited for displaying continuous data like stock prices or temperature changes.
  • Useful for making forecasts based on past patterns.
  • Effective for monitoring performance metrics over time.
  • Can compare trends across different categories or groups.

How to create a line chart in Power BI Desktop

Here we will see how to create a line chart in Power BI Desktop.

For example, we will use the below Excel sample data ‘Superstore.xlsx’ to create a line chart.

From this Excel data, we will use the sales and Segment columns to display sales based on the Segment in the Line chart.

line chart Power BI
  • Open Power BI Desktop, click on Excel Workbook, or click on Get data -> select Excel Workbook.
Power BI Line chart

Then select the Excel sheet from your local system; in the Navigator window, select the table and click the Load button.

line chart in power bi
  • Now, select the Line chart from the visualization pane.
  • You can see the blank Line chart in the Power BI Desktop canvas.
powerbi line chart
  • Next, we will add the data to the Power BI Line chart, for this, follow the steps:
    • Drag and drop the Segment column to the X-axis field.
    • In the Y-axis field, drag and drop the sales column.
how to make a line chart in power bi

This is how to create a line chart in Power BI Desktop.

Power BI line chart with multiple lines

Here, we will see how to display multiple lines in the Power BI line chart.

As in Power BI, we can create a single-line chart; we can also create multiple line charts to compare the two continuous data series based on category or period.

For example, we will create a line chart that will display the sales vs profit based on year-month.

Let’s follow the below steps to create a line chart with multiple lines.

  • In Power BI Desktop, select a Line chart from the visualization pane.
  • Now you can see the blank line chart is added to the canvas.
powerbi line chart
  • To show multiple lines in the line chart, drag and drop the Sales and Profit to the Y-axis.
  • In X-axis select the Order Date. As it is a date hierarchy format, you can select the Year and month.
  • Now you can see the multiple lines in the line chart.
Power BI line chart with multiple lines

Power BI line chart multiple values and legend

Here, we will see how to create a line chart with multiple values and legends.

Currently, in Power BI Desktop, line charts do not support multiple values with individual legends. You can utilize a single legend field with a corresponding value instead.

Power BI line chart secondary y-axis

Here, we will see how to show the secondary y-axis to the line chart in Power BI Desktop.

As in Power BI, a secondary Y-axis in line charts allows for comparing two datasets against a single X-axis. For example, you can compare sales and weather by month. This feature simplifies visualization when the data have different scales, saves report space, and enhances clarity. However, only the Y-axis can have a secondary axis in Power BI, while the X-axis remains shared between multiple columns.

For example, we will create a line chart that will display Sales vs Profit based on Region.

To display sales vs profit based on the region in the Power BI line chart, follow the below steps:

  • In Power BI Desktop, add a line chart to the Power BI canvas from the visualization pane.
  • Now you can see the blank line chart is added to the canvas.
power bi line chart

To show the secondary y-axis in the line chart, drag and drop the sales, profit, and Region in the Y-axis, secondary y-axis, and x-axis, respectively.

Now you can see the two lines i.e. from the y-axis and secondary y-axis in the Power BI line chart.

power bi line chart secondary y axis

This is how to display the secondary y-axis in the Power BI line chart.

Conclusion

In this Power BI tutorial, we learned What a Line chart visual is, when to use a line chart, and how to create a line chart in Power BI.

Furthermore, we learned how to display multiple lines in a Line chart and how to display the Power BI line chart secondary y-axis using Power BI Desktop.

You may also like:

>