Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Set line colors for top N line chart

I have a fairly simple line chart which uses a Top N (top 5) filter. No matter what the 5 top items are, I need to display the same 5 theme colors. This is easy to do with a bar chart using  RANKX measure and conditional formatting, but the conditional formatting option isn't available for line charts. There must be a workaround for this, but I can't find anything. Does anyone here have the answer?

Super User IV
Super User IV

@pozzy_iata not sure if there is a way since conditional formatting is not available for the line chart. 


I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at, your one-stop shop for Power BI related projects/training/consultancy.

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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Super User IV
Super User IV

@pozzy_iata , You can format the Marker. Have a bar visual first, set the conditional formatting there. Change it to the line visual. Maker will have color formatting

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Community Support
Community Support

Hi @pozzy_iata ,


Currently , it is not supported to set conditional formatting for line chart in Power BI . There is an idea about this issue, please vote it up,   Formatting, Annotating, and Highlighting Line Charts ,  add your comments there to improve Power BI and make this feature coming sooner.


While there is a workaround you may considerate. as  amitchandak's suggestion, you may create a Clustered column chart, set conditional formatting in Data color section , format by "Field value" . Then convert the bar visual to line chart. For reference: .


Best Regards,



Community Support Team _ Amy

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


@v-xicai  This approach doesn't quite seem to work - possibly because I need each line to be a different color, rather than the data points on a single line to be different colors?


This is my original line chart


So I need the 5 colors chosen in the legend at the bottom to always be the same, and I have a RANKX function which I could use to conditinally format them as I did with this bar chart:


But when I turn that bar chart into a line chart, it starts like this:



And once I change my legend, axis, and values back to match the original line chart (shown on the bottom), then the colors revert back and it's the same thing I started with.


Can you think of any other way this might be accomplished?




Helpful resources

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!


Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors