Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
MaggiB
Regular Visitor

How to display multiple lines associated with one legend color?

I am plotting athlete reaction time (y-axis) on different days (x-axis).  I have 5 athletes and I want each to have their own line, as seen in the example, but I only want four line colors because two of the athletes are taking the same amount of vitamins (80mg).  right now the legend is a combination of dose (mg) and ID#, but I really only want four in the legend with just dose.  However, if I change my legend to dose, the chart summarizes the pink and yellow lines & only displays one line.  Please help, how can I get 5 lines with only 4 in legend.  [i realize i could manually change the yellow to pink, but I have about 20 of these charts and I do not want that manual work for each report, also do not want the 5 dots at top (only four).]   Thank you!

 

example_lines.png

 

 

1 ACCEPTED SOLUTION

Thank you so much for looking into this.  As a note for other readers, I found that it might be possible with the ggplot2 package from R, but I have not yet tested.  Again thank you, and we can close this question.

View solution in original post

4 REPLIES 4
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

Hi @MaggiB,

In your scenario, there is no automatic way  to change the line color, you have to manually change the yellow to pink. And unless you change the legend to does, you will have 5 dots at top.

Thanks,
Lydia Zhang

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

Is there a way to do it with R-programming?

Hi @MaggiB,

Based on my reserach, it is not possible to use R to create multiple lines that associate with only one legend.

Thanks,
Lydia Zhang

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

Thank you so much for looking into this.  As a note for other readers, I found that it might be possible with the ggplot2 package from R, but I have not yet tested.  Again thank you, and we can close this question.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.