Forum Discussion

Starseed's avatar
Starseed
Frequent Visitor
6 years ago
Solved

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):

 

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:

 

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

  • Hi Starseed ,

     

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

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

    You can get this result.

     

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

2 Replies

  • V-lianl-msft's avatar
    V-lianl-msft
    Community Support

    Hi Starseed ,

     

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

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

    You can get this result.

     

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

    • Starseed's avatar
      Starseed
      Frequent Visitor

      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.