cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Starseed
Frequent Visitor

Help with creating a line chart

I'm running into an issue trying to create a line chart.  This is what I'm trying to do (excel visual):

1.jpg

 

I've imported a table like this, with other columns such as year, project ID, title, etc.  And like the table above, it has columns for January, February, March, etc.  Note: There are multiple rows listing out all the projects, and each project ID has 2 rows with type equal to 'planned' or 'actual'.  I'm filtering my reports by project ID.

 

When trying to create a line chart comparing planned vs actual, I get this:

2.jpg

 

How can I fix this?  I feel like I have tried everything (aside from restructuring all the data I'm importing).

1 ACCEPTED SOLUTION
V-lianl-msft
Microsoft
Microsoft

Hi @Starseed ,

 

First, select the type column in the query editor and unpivot other columns.

test_unpiovt_month.PNG

Incorrect month sorting may appear in the chart. You can create a condition column to sort.

test_conditional_column.PNG

You can get this result.

test_Help with creating a line chart.PNG

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
V-lianl-msft
Microsoft
Microsoft

Hi @Starseed ,

 

First, select the type column in the query editor and unpivot other columns.

test_unpiovt_month.PNG

Incorrect month sorting may appear in the chart. You can create a condition column to sort.

test_conditional_column.PNG

You can get this result.

test_Help with creating a line chart.PNG

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Great!  Got it to work.  Thanks for your help.

 

Reference for others looking to see how I solved the problem with the solution above:

  • I duplicated the table so other reports can still use the original data format.
  • I highlighted my Project Id and Year columns along with the Type column before selecting "Unpivot Other Columns", this way these columns didn't get merged into my date values.
  • I merged my Month column with the Year columns and converted it to a date which allowed me to skip the conditional column step in the solution above.

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

March Update

Check it Out!

Click here to read more about the March 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors