Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

My line chart data points will not connect

Hi,

 

I have 3 seperate data tables. A data point from each of these tables is to be used on my line chart.

 

I have 1 extra common table, where I want my categorical axis to come from.

 

This common table is connected to each 3 data tables in a many to one relationship. 

 

However when I plot my 3 seperate data points, with the axis coming from the common table, the line chart does not connect.

 

Can anyone help please? 

  • Hi Anonymous ,

     

    Are your Line chart and tables look like following? 

     

     

    We can create a measure to meet you requirement:

     

    aggreFromOtherTable = 
    SWITCH (
        SELECTEDVALUE ( 'Table'[Column1] ),
        "A", SUM ( 'Table (2)'[Column2] ),
        "B", SUM ( 'Table (3)'[Column2] ),
        "D", SUM ( 'Table (4)'[Column2] )
    )

     

     

    If it doesn't meet your requirement, kindly share your sample data and expected result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.


    BTW, pbix as attached.

     

    Best regards,

    Community Support Team _ Dong Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

7 Replies

  • v-lid-msft's avatar
    v-lid-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    Are your Line chart and tables look like following? 

     

     

    We can create a measure to meet you requirement:

     

    aggreFromOtherTable = 
    SWITCH (
        SELECTEDVALUE ( 'Table'[Column1] ),
        "A", SUM ( 'Table (2)'[Column2] ),
        "B", SUM ( 'Table (3)'[Column2] ),
        "D", SUM ( 'Table (4)'[Column2] )
    )

     

     

    If it doesn't meet your requirement, kindly share your sample data and expected result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.


    BTW, pbix as attached.

     

    Best regards,

    Community Support Team _ Dong Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Many thanks v-lid-msft 

       

      This worked beautifully. 

       

      Would you be able to share the logic behind the measure? I have read up but I cannot seem to grasp it. 

       

      Thanks as well parry2k for your help.

       

      Thank you

       

      Water

      • v-lid-msft's avatar
        v-lid-msft
        Icon for Community Support rankCommunity Support

        Hi Anonymous ,

         

        Of course we will explain this measure, First of all, there are three values from the 'Table'[Column1], we use SELECTEDVALUE to identify what is the value of x-axis and use SWITCH to get different result based on the value of 'Table'[Column1], when the x-axis is A, we calculate the sum value fo 'Table (2)', if the value of x-axis changed, we calculate for another table, Then we are able to show different value for differnt x-axis values. We can also change the SUM formula to another formula to calculate other value you want. The reason that those dots can connect is because the values of dots are come from the same measure.

         

        aggreFromOtherTable = 
        SWITCH (
            SELECTEDVALUE ( 'Table'[Column1] ),
            "A", SUM ( 'Table (2)'[Column2] ),
            "B", SUM ( 'Table (3)'[Column2] ),
            "D", SUM ( 'Table (4)'[Column2] )
        )

         

        Best regards,

        Community Support Team _ Dong Li
        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Just an update on this:

     

     

    I have tried googling to see if I can find a similar issue but I can't.

     

    Any help is greatly appreciated.

     

    Thanks

     

    Water

    • parry2k's avatar
      parry2k
      Icon for Super User rankSuper User

      Anonymous can you share how you are putting measure on values section of line chart?

       

      Any sample data with example would be great.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Parry2k,

         

        I am using calculated columns and not measures, if that is useful information?

         

        I have 3 databases/tables:

        1. I calculate the figure for each year (ranging from 2009 to 2017)

        2. I calculate the 2018 performance

        3. I calculate the 2019 YTD performance

         

        I then connect each of these 3 tables individually with my "joiner" table.  I use my "joiner" table as my x-axis but the line chart just shows dots and doesn't connect them. 

         

        Thanks

         

        Water