Forum Discussion
Dynamically Change Line Colors Based on a Threshold
- 1 year ago
Hello Kedar_Pande
Check out the below article
https://medium.com/@simon.harrison_Select_Distinct/conditional-format-a-line-chart-in-power-bi-61e25a70e431
Thanks & Regards... - 1 year ago
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
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.
- Conditional Formatting on the Line Chart: Unfortunately, Power BI does not yet support direct conditional formatting for line chart lines. So, the approach would be to split the data based on the threshold.
- You can use an approach like splitting your data into two measures for plotting two lines, one for growth above the threshold and one for below.
- Alternatively, if this approach doesn’t fit your needs, you can submit an idea for dynamic line chart formatting on the Power BI community page. The Power BI community is constantly improving based on user feedback.
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