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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Community Support
Community Support

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
Community Support
Community Support

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors
Top Kudoed Authors