Power BI Line Chart is useful for visualizing Trends over time. For example, you can use this to create a Sales trend, Temperate Trend, etc. Let me show you how to create a Line Chart with an example.
For this Power BI Line Chart demonstration, we are going to use the SQL Data Source that we created in our previous article. So, Please refer to Connect to SQL Server article to understand the Power BI Data Source.
How to 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 checkmark the State Province column.
By clicking the shown icon under the Visualization section, Power BI automatically converts the Column into Line Chart.
From the below screenshot, you can see the Line Chart that shows the Sales Trend by State Province Name.
Create a Line Chart Approach 2
First, click on the Line Chart under the Visualization section, then Power BI will automatically create it with dummy data.
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.
Let me sort the data by State Province Name (By default, it is sorted by Sales Amount). To do this, click on the … (3 dots) on the top right corner and select the Sort By StateProvinceName option.
Now you can see the proper Trend in the Power BI line chart.
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 Tool-tip of Sales Amount and Total Product Cost.
Let me do some quick formatting to this Power BI Line Chart
NOTE: I suggest you refer to the Format article to understand the steps involved in formatting these Lines.
Under the Visualization section, Selecting the Line Chart icon will generate a dummy one. Next, add dates or text fields to X-axis and Numeric measures to Y-axis.
Line charts, also known as the trends that visually represent the data changes over a period of time. For instance, sales trends in an interval, profits over the years, etc.
There are two ways to show multiple lines. The first one is adding multiple numeric measure values to the Y-axis section. The second approach to adding dimension (text) field to legend.
Use the analytics pane to add the trend lines, constant, min, max, average, median, and percentile lines.