In this blog, we’ll learn How to Create Line Chart in PowerBI Firstly, we have to understand what is it and when should we use it.
Introduction to Line chart in PowerBI
A line chart plots data points connected by straight lines, showing trends over time or continuous variables. It’s ideal for visualizing changes, patterns, and trends in data across intervals. Use it to track progress, compare multiple datasets, or highlight correlations, such as sales over months or temperature changes over years.
Dataset description
We will be using a supermarket sales dataset for this blog. This dataset has information about transactions such as the invoice ID, branch, city, customer type, gender, product line, unit price, quantity, tax, total amount, sale date and time, payment mode, cost of goods sold (COGS), gross margin percentage, gross income, or buy rate. You can make a line chart from this dataset because it gives you a lot of information about payment and customer types.
You can access the dataset here.
Invoice ID | Unique Identifier for each Invoice |
Branch | There are four branch Site |
City | City where transactions occurred |
Customer Type | Type of Customer – Member or Normal |
Gender | Gender – Male, Female |
Product Line | Type of Product |
Unit Price | Price of a Single Unit of Product |
Quantity | Total Quantity of Product Sell in a Single Purchase |
Tax 5% | 5% of Tax on Cost of Goods Sold |
Total | Total Amount of Items without Tax |
Date | Date of Sale |
Time | Time of Sale |
Payment | Mode of Payment |
COGS (Cost of Goods Sold) | Total Amount of Items with Tax |
Gross Margin Percentage | Total Profit in Percentage |
Gross Income | Total Profit |
Rating | Raing of the purchase in range of 1-10 |
Data Sample:
Procedure to Create Line Chart in PowerBI
Step1: Open your PowerBI Desktop on your Device
Step2: Click on Get Data button in Home Ribbon and select Text/CSV.
Step3: Open Prompt box will be open to select your text or csv file.
Step4: After selection of dataset, It will pop up a window for Load OR Transform Data. Click on Load to use data on PowerBI.
Step5: In the following picture, data has been loaded successfully.
Step6: Select Line Chart from Visualizations Section (Right Hand Side).
Step7: Here, we’ll put the following data (from supermarket_sales) in different fields:
X-axis | Payment |
Y-axis | Quantity (Sum of Quantity) |
Legend | Customer type |
After that you have to click on format your visual. Go to the General click on turn on visual border and the shadow. In the Visual border make the rounded corner of 15 px. After that Go to Visuals and turn on the data labels.
What the Chart indicating:
The line chart in PowerBI shows that members who paid with cash (885 units) and e-wallets (948 units) bought more items than regular users who paid with credit cards (1002 units). Credit card payments made up the largest group, with a total of 1722 units.
Conclusion
With a Line Chart, we can view our categorical and numeric data as line in x-axis and y-axis. There is a functionality of marker (looks like bubble) present the change of variable. We can get the details of each point/line by moving the cursor over the line or marker and show much details using tooltip field.
If you like this blog, you can share it with your friends or colleague. You can connect with me on social media profiles like LinkedIn, Twitter, and Instagram. If you have any doubt regarding implementation feel free to comment.
🔔 Follow Me: LinkedIn| Youtube | Instagram | Twitter
👏 Like for this article and subscribe to our newsletter
📰 View more content on my DataSpoof website