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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Pikachu-Power
Impactful Individual
Impactful Individual

line chart color cant be changed when legend is a measure

Hello all,

 

i am surprised that i cant change the color of a line chart. I have a line chart and i change the color to blue. When i move a measure to the legend it changes back to green and the color button gets illuminated 😐 To change the color is not allowed any more. Maybe a bug? In the past it was never an issue.

 

Best regards

 

PS:

When i change the content of the measure with a slicer the colors change. I have no control of that. 

Seems like a bug. For column line chart it works but there i dont get a title. It is necessary to use a column to get a title.

 

1 ACCEPTED SOLUTION

Hi @Pikachu-Power,

 

You are correct on what you refer, the trick here is to force the colors before having the selection on the slicer, has you can see on my image the color is still the same when I select A (Red) this is because I have forced the color  on the settings with everything selected on the slicer.

MFelix_0-1720529527216.pngMFelix_1-1720529534363.png

 

When you have the stacked bar chart it also does not allow to format it when you have a selection because then the selection is not based on the Legend but on the axis values:

 

MFelix_2-1720529761979.png

 

MFelix_3-1720529777749.png

 

 

 

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

7 REPLIES 7
MFelix
Super User
Super User

Hi @Pikachu-Power ,

 

You cannot change measures into the legend, so I assumer you refer a column correct? When you add a column to the legend then to change the colors you need to select each individual value of the legend to select the colors you need:

MFelix_0-1720445235487.pngMFelix_1-1720445250421.png

MFelix_2-1720445268200.png

 

In my example the legends are dates.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi @MFelix ,

 

Yes Sorry it is a column i created it like following:

 

Measure_Google =
DATATABLE (
"Measure",STRING,
"Order",INTEGER,
    {
        { "A",1 },
        { "B",2 },
        { "C",3 },
        { "D",4 }
    }
)
 
I mixed it up because i called it measure but it is a column. But if you put this column to the legend under the section lines / series nothing opens. No A, B, C, D.

Are this values linkd with the ones on the line itself?


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hello @MFelix 

 

in this created table i use following measure 

 

Metrik =
SWITCH(TRUE(),
    SELECTEDVALUE(Measure_Google[Measure]) = "A", [Formula1],
    SELECTEDVALUE(Measure_Google[Measure]) = "B", [Formula2],
    SELECTEDVALUE(Measure_Google[Measure]) = "C", [Formula3],
    SELECTEDVALUE(Measure_Google[Measure]) = "D", [Formula4],
BLANK())
 
X-Axis: calender (linked with the table with the formulas).
Values for the line graph are the column "Measure" and the measure Metrik above.
The table Measure_Google is not linked with anything.
 
A solution:
I would jump to the line graph with grouped or stacked bar charts. There it is no problem and i can control the colors. The problem with the title i could solve. So for the line graph it still looks like a bug for me. 
 
 

Hi @Pikachu-Power ,

 

I tried to replicate your model and was abble to create a line chart and change the color using the series selection on each one.

MFelix_0-1720515859404.png

See PBIX file attached.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi @MFelix 

 

Thank you for recreating the issue. That is correct. Could you please put a slicer on the canvas and try it again?

 

2024-07-09 11_20_39-Window.png

 

Than it is not possible any more. But i can dissolve the filter, set the colors and set a filter again. This would provide a solution. But should this the normal way?

 

Something else: If you choose "All" the color is not controllable. Does that make sense?

 

Thank you!  

Hi @Pikachu-Power,

 

You are correct on what you refer, the trick here is to force the colors before having the selection on the slicer, has you can see on my image the color is still the same when I select A (Red) this is because I have forced the color  on the settings with everything selected on the slicer.

MFelix_0-1720529527216.pngMFelix_1-1720529534363.png

 

When you have the stacked bar chart it also does not allow to format it when you have a selection because then the selection is not based on the Legend but on the axis values:

 

MFelix_2-1720529761979.png

 

MFelix_3-1720529777749.png

 

 

 

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
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.