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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Karim_Hossam
Employee
Employee

line chart to represent slaes in three years

Hi,

I have an excel with 3 columns (sample below)
1- for months
2- for years
3- sales value

YearMonthsSales
2019815000
202024000
202032322
2020953354
201922222
20211233
20191187764
2020107565
20191136935
20201214785
20191546


I am trying to build a line chart , in which each line represents the sales in a year.(desired outcome in the screenshoot below)

line chart.png
How I can do this?, do I need to use DAX expressions?

Thanks

1 ACCEPTED SOLUTION
DataZoe
Employee
Employee

@Karim_Hossam You can just use a line chart with the X axis as your months, legend as your year, and the sales as your values.  

DataZoe_2-1610672783538.png

 

After you create that, check your x-axis and make sure the type is categorical (not continuous, as it may try as the months are numbers), and that you sort it by month, not sales value.

 

DataZoe_0-1610672700196.pngDataZoe_1-1610672738673.png

 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

View solution in original post

1 REPLY 1
DataZoe
Employee
Employee

@Karim_Hossam You can just use a line chart with the X axis as your months, legend as your year, and the sales as your values.  

DataZoe_2-1610672783538.png

 

After you create that, check your x-axis and make sure the type is categorical (not continuous, as it may try as the months are numbers), and that you sort it by month, not sales value.

 

DataZoe_0-1610672700196.pngDataZoe_1-1610672738673.png

 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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