Forum Discussion
Dynamic Formatting Area chart
Hi,
I want to create an area chart that changes to red(area and line color) when a measure is negative and be green when positive like this:
Is there a way to do this in powerbi or a custom visual i cannot find anything.
Thanks!
Not the full solution, but half a solution:
Conditional formatting is available for bar charts, but I can't see it for line or area charts.
You can start with a column chart and set the conditional formatting under Visual > Columns > Color as follows, using a field with the color hex in your table (click on the FX button and select field value and then the hex color from your table).This will give you a bar graph with conditional coloring as follows:
If you then change the graph to Line, it retains the colors as the markers, but not for the line.
There doesn't appear to be a marker setting, but it does seem to work.
2 Replies
- FlipFlop1Advocate I
Not the full solution, but half a solution:
Conditional formatting is available for bar charts, but I can't see it for line or area charts.
You can start with a column chart and set the conditional formatting under Visual > Columns > Color as follows, using a field with the color hex in your table (click on the FX button and select field value and then the hex color from your table).This will give you a bar graph with conditional coloring as follows:
If you then change the graph to Line, it retains the colors as the markers, but not for the line.
There doesn't appear to be a marker setting, but it does seem to work.
- lbendlinSuper User
yes, this can be implemented. Is the static horizontal line not enough?
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523