Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
CH_MJR79
Helper II
Helper II

How to create a line chart?

Hello all,

I have an Excel data source and am trying to find a way of creating a line chart in Power BI.

 

The data source has a list of account codes, descriptions and columns showing the individual totals for each account code over four years.

 

Creating a line chart in Excel is as easy as selecting the column headings for the x-axis and the Sales totals for the four years as for the y-axis.

 

Can anyone tell me the best way of doing this in Power BI?

 

This is what the Excel data looks like, along with the Excel line chart.

 

CH_MJR79_0-1708014313808.png

 

 

8 REPLIES 8
mh2587
Super User
Super User

I am mean screenshot 


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



CH_MJR79
Helper II
Helper II

that's how I've done it. There are four attributes, named Attribute-2020, Attribute-2021, Attribute-2022 and Attribute-2023, along with four values (individual measures) named Sales2020, Sales2021, Sales2022 and Sales2023.

 

I think it is stacking/showing the values in a vertical line because the Attribute fields aren't date/time fields (they are not supposed to be).

mh2587
Super User
Super User

Unpivot the data first in power query and then drage the line chart in visual convas and put attribute in x axis and value in Y axis


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



I've tried that, but it puts the X-Axis attributes vertically instead of horizontall with the line:

 

CH_MJR79_0-1708080889767.png

 

Put Attribute on X-axis and Value on Value in field section


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



@mh2587 That still does the same unfortunately.

Can you paste SS your field values in visualization pane ?

 


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



I don't fully understand what you mean by paste SS the field values. Can you elaborate please?

 

This is a cut-down version of the data source. For the line chart I need it to show the sum of the 2023-Totals figures for the two sales codes only (Account 1 and 2) and then a line going to the sum of the 2022-Totals figure again for the same two sales codes (Account 1 and 2).

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors