Power BI Line Chart is useful to visualize the Trends. For example, you can use this to create a Sales trend, Temperate Trend, etc. Let me show you how to create a Line Chart in Power BI with 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 Power BI 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 State Province Name to the Axis section. You can do this by dragging State Province to Axis section, or simply checkmark the State Province column.
By clicking the Line Chart under the Visualization section, it automatically converts the Column Chart 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 in Power BI Approach 2
First, click on the Line Chart under the Visualization section. It will automatically create a Line Chart with dummy data.
In order to add data to the Power BI 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 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
Let me add one more field, i.e., Total Product Cost to Values section. It will compare the trend of the Sales Amount against the Total Product Cost.
Hover 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 to refer Format Line Chart article to understand the steps involved in formatting these Lines.