Forum Discussion

Anonymous97's avatar
Anonymous97
Frequent Visitor
2 years ago

Line chart show multiple lines based on selected values

Hello,

I have a requirement for line chart where i need to show to the no.of lines based on the selected filter

x axis- Text column(test1)

y axis- range from 0 to 6(test2)

legend - text column(values)

I have columns id, test1, test2, values and slicers for id and measure , if a user selects 2 different id's i have to show 2 different lines but the issue is here for example 

id =1, text1=abc,text2=0.6,legend=xyz

id=2,text1=abc,text2=0.6,legend=xyz

in Slicer if I select two id's it is giving me single line with adding the values 0.6+0.6. Is there any possibility to achieve this.

 

  • Thanks in advance.

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous97 

     

    With 'values' in the Legend field, Power BI will attempt to create a separate line for each unique value in the 'values' column. If 'values' is the same for both 'id' = 1 and 'id' = 2, Power BI will naturally try to combine these because it sees them as not distinct. If you want separate lines for each 'id' , you can create a new column that concatenates  'id' and 'values' to make them unique and then put the new column in legend.

     

     

    Best Regards,

    Jayleny

     

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

    • Anonymous97's avatar
      Anonymous97
      Frequent Visitor

      Hello Anonymous ,

       

      Thank you for the reply.

      I have already tried this by concatenating the id and value and I was able to acheive the requirement, but when we hover over the legend it is showing both id and values concatenated and the user only wants to see the values.

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous97 

         

        You only need to make sure that the values of the legends of id=1 and id=2 are not the same, not necessarily the splicing of id and value.

         

         

        Best Regards,

        Jayleny

         

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