Forum Discussion

e175429's avatar
e175429
Helper IV
2 years ago
Solved

Multiple Lines on One Chart

Hey Everyone,

 

I am trying to put 2 lines on one chart from 2 different tables to compare data over 2 years. Seperately, they are:

and

When I attempt to put them on one chart I get:

As you can see, the data points are all wrong.

 

Below is the data I am using.

2024.xlsx

2023.xlsx

What am I doing incorrectly?

 

Regards

  • Anonymous's avatar
    Anonymous
    2 years ago

    Thanks for the reply from arava and ahadkarimi.

    Hi e175429 ,


    When using the 2024 PLEA field as the x-axis, it seems to appear as you would expect, but on closer comparison, the data is incorrect.

    I will provide an alternative method and here are the steps to do it:


    1.Create a new table, this table contains unique PLEA column values extracted from 2023 and 2024 (Sheet1):

    Newtable =
    SUMMARIZE (
        UNION (
            SELECTCOLUMNS ( '2023', "PLEA", '2023'[PLEA] ),
            SELECTCOLUMNS ( '2024(Sheet1)', "PLEA", '2024(Sheet1)'[PLEA] )
        ),
        [PLEA]
    )
    

     

    2.The relationship between the three tables is created as shown below:

     

    3.Using the PLEA of the newly created table as the x-axis, you can get a line graph with the correct data:

     

     

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

     

    Best Regards,
    Zhu
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

15 Replies