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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
NaomiSH
Regular Visitor

Creating a line graph

Good afternoon,

Thanks for your help on my last question.  I now have another that has probably already been asked and answered but I can't seem to find it.  I have a single row of data I am trying to put in a line chart where the X-axis is in months and the y axis is in values.  How do I build my visual (line graph)?  When I try the points are like a scatterplot in one row or none at all.

1 ACCEPTED SOLUTION

@NaomiSH 

in pq you can create a new column

 

= if [2025] = "January" then 1
else if [2025] = "February" then 2
else if [2025] = "March" then 3
else if [2025] = "April" then 4
else if [2025] = "May" then 5
else if [2025] = "June" then 6
else if [2025] = "July" then 7
else if [2025] = "August" then 8
else if [2025] = "September" then 9
else if [2025] = "October" then 10
else if [2025] = "November" then 11
else if [2025] = "December" then 12
else null

 

11.png

 

then make sure the new column's data type is whole number and sort 2025 by the new column

 

22.png

 

at last sort by the 2025 column

13.png

 

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
NaomiSH
Regular Visitor

Wait!  I think I'm close.  I just need to figure out how to get the months in the correct order.  They are listed in order on the uploaded data.

Screenshot 2025-05-14 question.png

ryan_mayu
Super User
Super User

@NaomiSH 

I think you need to go to Power query 

 

1. use header as first row

11.png

 

2. transpose

12.png13.png

 

then you drag column 1 to x-aixs and column 2 to y x-axis to build the line chart.

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I ran it through PowerQuery.  Obviously, I can post real data on here but after running through PowerQuery, this is (kind of) what is loaded.

Screenshot 2025-05-14 090041.png

@NaomiSH 

in pq you can create a new column

 

= if [2025] = "January" then 1
else if [2025] = "February" then 2
else if [2025] = "March" then 3
else if [2025] = "April" then 4
else if [2025] = "May" then 5
else if [2025] = "June" then 6
else if [2025] = "July" then 7
else if [2025] = "August" then 8
else if [2025] = "September" then 9
else if [2025] = "October" then 10
else if [2025] = "November" then 11
else if [2025] = "December" then 12
else null

 

11.png

 

then make sure the new column's data type is whole number and sort 2025 by the new column

 

22.png

 

at last sort by the 2025 column

13.png

 

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I tried doing it with the two columns (one column months, one column data) but it is setting it to count.

 

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors
Top Kudoed Authors