Power BI Line Chart

Power BI Line Chart is useful for visualizing Trends or data changes over time. For example, you can use a Line graph to create a Sales trend in an interval, Temperature Trend, profits over the years, etc. Let me show you how to create a Line Chart with an example.

For this Line Chart demonstration, we will use the SQL Data Source we created in our previous article. So, Please refer to Connect to SQL Server and the List of Charts articles to understand the Power BI Data Source.

Create a Line Chart in Power BI

To create a Line Chart, first Drag and Drop the Sales Amount from the Fields section to the Canvas region. It automatically creates a Column Chart. Next, let me add the State Province Name to the Axis section. You can do this by dragging State Province to the Axis section or check marking the State Province column.

By clicking the shown icon under the Visualization section, the desktop automatically converts the Column into a Line Chart. From the screenshot below, you can see the Line Chart that shows the Sales Trend by State Province Name.

Create a Power BI Line Chart 2

Create a Power BI Line Chart using Visualization

First, click on the Line Chart under the Visualization section, and then the desktop will automatically create it with dummy data. Next, add dates or text fields to the X-axis and Numeric measures to the Y-axis.

In order to add data to the Line Chart, we have to add the required fields:

  • Axis: Please specify the Column Name that represents the Trend.
  • Values: Any Numeric value such as sales amount, Total Sales, etc.

Let me drag the Sales Amount from the Fields section to the Values field and the State Province Name to the Axis section. Next, sort the data by State Province Name (By default, it is sorted by Sales Amount). To do this, click on the … (3 dots) in the top right corner and select the Sort By StateProvinceName option.

Sort the Line Chart

Now you can see the proper Trend in the Power BI line chart.

There are two ways to show multiple lines on a Power BI line graph. The first one is adding multiple numeric measure values to the Y-axis section. The second approach is adding a dimension (text) field to the legend.

Let me add one more field, i.e., the Total Product Cost to Values section. It will compare the trend of the Sales Amount against the Total Product Cost. Hovering over any position shows the tooltip of Sales Amount and Total Product Cost.

Create a Line Chart and show Tooltip

Apart from comparing the two, you can use the Power BI analytics pane to add the trend lines, constant, min, max, average, median, and percentile lines.

Let me do some quick formatting to this Line Chart. I suggest you refer to the Format article to understand the steps in formatting these Lines.

Formatted Line Chart