Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a line chart showing "Sales Growth" over time, and I want to change the line color based on a threshold value (e.g., if growth is above 10%, the line should turn green; if below 10%, it should turn red).
Is there a way to apply this dynamic color change directly to the line chart in Power BI without splitting the data into multiple lines? What’s the best way to implement this?
Example Data:
Date Sales Growth
Jan 2024 12%
Feb 2024 8%
Mar 2024 15%
Solved! Go to Solution.
Hello @Kedar_Pande
Check out the below article
https://medium.com/@simon.harrison_Select_Distinct/conditional-format-a-line-chart-in-power-bi-61e25...
Thanks & Regards...
To achieve dynamically formatted color changes on a line chart (markers only) you can use conditional formatting on the markers. But, this requires initially creating a bar chart with conditional formatting and then changing it to a line chart. Or else you can try multiple measure approach.
check this thread - https://community.fabric.microsoft.com/t5/Desktop/Line-Chart-Conditional-Formatting/m-p/375161
Hi @Kedar_Pande
Currently Power BI's line charts do not support dynamic color changes based on thresholds on a single line.
As BIswajit_Das and Arul mentioned in their replies, it is currently possible to have a conditionally formatted bar chart and then change it to a line chart to achieve a similar effect.
If this alternative is helpful to you, please consider accepting their replies as a solution.
Or you can submit an idea at ideas.
Thank you for your understanding.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I’ve already tried the bar chart workaround, but I need an exact solution to display the dynamic color changes based on thresholds on a single line.
In Power BI, dynamic color changes based on a threshold for line charts are not directly supported in a single line chart visual. However, you can work around this limitation using the conditional formatting feature in combination with measures to achieve the desired effect. Here’s how you can implement it:
Step-by-Step Approach:
Create a Measure to Set Dynamic Color: You'll need to create a new measure to define the color logic based on your threshold (in this case, 10%).
Go to the Modeling tab and create a new measure with the following DAX formula:
Add a New Line Chart: Add your existing line chart using Date for the axis and Growth for the values.
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
Let's Connect on LinkedIn: https://www.linkedin.com/in/anmol-malviya/?originalSubdomain=in
I need an exact solution to display the dynamic colour changes based on thresholds on a single line.
I will submit the idea.
Thanks
To achieve dynamically formatted color changes on a line chart (markers only) you can use conditional formatting on the markers. But, this requires initially creating a bar chart with conditional formatting and then changing it to a line chart. Or else you can try multiple measure approach.
check this thread - https://community.fabric.microsoft.com/t5/Desktop/Line-Chart-Conditional-Formatting/m-p/375161
Thanks for the reply @Arul .
This workaround can be used as changing colours on the line chart is not supported currently.
Hello @Kedar_Pande
Check out the below article
https://medium.com/@simon.harrison_Select_Distinct/conditional-format-a-line-chart-in-power-bi-61e25...
Thanks & Regards...
User | Count |
---|---|
76 | |
75 | |
46 | |
31 | |
28 |
User | Count |
---|---|
99 | |
91 | |
51 | |
49 | |
46 |