Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Need help for creating Line Graph

Need help to create a line graph with months in the x axis for the given below table. Project number is not necessary to be displayed or even used in graph. 

I want to show the performance on monthly bases.

For example - jan = "sum of all the sales in Jan" is one value

ProjectJanFebMarApril
122222222
234343434
333333333
455555555
566666666
677777777

 

Example of line graph 

 

  • In Power Query, you can try the following (you need a column for sorting purposes):

    1) If the periods are sorted properly, add an index column

    2 If the periods are not sorted chronologically, add a conditional column along the lines of:
    If the period table = Sales P01 (actual) then 1

    If the period table = Sales P02 (actual) then 2

    ....

     

    Once the table is loaded, go into the table view, select the period table and in the ribbon, select "Sort by column" and select the order column.

3 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Icon for Community Champion rankCommunity Champion

    You need to unpivot the month columns in Power Query. Then setting up the graph os straightforward .

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi i used the unpivot in power query. 

      When i tried the line chart, im getting the below output. 

      Please advise on how to have the x axis values from P01 - P07 

       

      The x axis in not in ascending order. I did sort the coloumn in table but still the graph is shown like this.

      • PaulDBrown's avatar
        PaulDBrown
        Icon for Community Champion rankCommunity Champion

        In Power Query, you can try the following (you need a column for sorting purposes):

        1) If the periods are sorted properly, add an index column

        2 If the periods are not sorted chronologically, add a conditional column along the lines of:
        If the period table = Sales P01 (actual) then 1

        If the period table = Sales P02 (actual) then 2

        ....

         

        Once the table is loaded, go into the table view, select the period table and in the ribbon, select "Sort by column" and select the order column.