Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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?
Hi @Anonymous ,
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: https://www.youtube.com/watch?v=A4iG8S4EpHs .
Best Regards,
Amy
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?
Thanks!
@Anonymous 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 https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
125 | |
76 | |
71 | |
57 | |
49 |
User | Count |
---|---|
161 | |
84 | |
68 | |
66 | |
61 |