Forum Discussion
Wrong behaviour in conditional formatting for lines
- 4 days ago
Hi santiagoremon37,
Thanks for testing this further and for sharing the PBIX. This is now a much stronger reproduction than the original flat-line case.
Based on what you found, I would describe this as a reproducible interaction between conditional line colouring and the active report theme rather than state that we know the internal root cause.
Microsoft's current conditional formatting documentation explicitly supports Field value formatting where a measure returns a colour name, hex code, or report-theme colour name.
The report theme documentation describes dataColors as the palette used for data colours, but I do not see any documented requirement saying that a uniformly conditionally formatted line must use the first entry in dataColors.
So the behaviour you reproduced does not appear to be an expected documented limitation.
Your test case is particularly useful:
- fixed line colour -> line renders
- conditional colour with all points returning the same colour and that colour equals dataColors[0] -> line renders
- conditional colour with all points returning the same colour but it differs from dataColors[0] -> markers remain, but the line stroke disappears
- changing one value/colour -> line renders again
- changing the theme so the returned colour becomes dataColors[0] -> line renders again
I would report this now rather than keep changing the DAX.
Microsoft has a dedicated Power BI Issues area specifically for reproducible product bugs. I would post the minimal PBIX there together with:
- Power BI Desktop version 2.157.879
- the minimal custom theme JSON
- the colour measure
- the exact steps above
- screenshots of the working and failing states
I would also use Power BI Desktop Help -> Report a problem and, if you have Microsoft support access, open a support case with the same minimal PBIX.
Microsoft's support-ticket guidance specifically recommends providing a simplified reproducible example and PBIX where possible, so the file you have built is exactly the type of evidence that should help the visual team investigate this.
As a temporary workaround, if only one uniform conditional colour is required, making that colour the first dataColors entry appears to work based on your testing. I would treat that only as a workaround, though, because it obviously does not scale if different states need different uniform colours.
I think this is worth reporting as a line-chart conditional-formatting/theme interaction rather than a data-model issue.
AI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.
Hi santiagoremon37,
I agree with the workaround already suggested, but based on your screenshots I think there is one useful distinction here.
Microsoft made conditional formatting for line charts Generally Available in the July 2026 Power BI update, and the current conditional formatting documentation explicitly supports conditional line colours and line-segment formatting.
I also do not see a documented limitation saying that a line with identical Y values should stop rendering when conditional formatting is enabled.
Your reproduction is quite specific:
- with a fixed colour, the flat line renders;
- with conditional formatting enabled and all values identical, the markers remain but the connecting line disappears;
- as soon as one value differs, the line renders again.
That makes this look more like a rendering edge case in the conditional-formatting path than expected line-chart behaviour.
If you are currently using Gradient formatting, one thing I would test before splitting the logic into multiple measures is either switching the line colour formatting to Rules / Field value, if your colour logic allows it, or setting explicit minimum and maximum values rather than using automatic gradient bounds.
Microsoft documents that line colours can use gradient, rules, or field-value formatting, so a field-value measure returning the required colour can sometimes preserve the dynamic behaviour without relying on the gradient calculation.
I would still report the reproducible case through Power BI Desktop because the flat-series behaviour itself does not appear in the documented limitations. Including the Desktop version, the small reproducible PBIX, and the three states you showed here should make the issue much easier to investigate.
AI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.
Here is the pbix with the 3 examples. I found that the issue is related to the theme.json file, because it only happens with specifically themes.
The thing is that in my report I'm using a custom theme and I need to adapt it, in order to be able to do that I need to find the exact line code that is causing this. If you can help me that would be great, thanks in advance :)
- santiagoremon376 days agoNew Member
ShivekMaharaj I found the problem, is a really strange bug.
Symptoms
On a line chart, when the line color is set via conditional formatting (a measure that returns color codes), the line is invisible whenever all points show the same value/color. Only the markers are drawn (or nothing at all if markers are disabled).
Root cause
Power BI only draws a uniformly-colored, conditionally-formatted line when that color matches the first color of the active theme (`dataColors[0]`). Any other uniform color → the line stroke is dropped.
- Line works when the single uniform color happens to match `dataColors[0]`.
How we can do in order to people from Microsoft be aware of this?- ShivekMaharaj4 days ago
Resident Rockstar
Hi santiagoremon37,
Thanks for testing this further and for sharing the PBIX. This is now a much stronger reproduction than the original flat-line case.
Based on what you found, I would describe this as a reproducible interaction between conditional line colouring and the active report theme rather than state that we know the internal root cause.
Microsoft's current conditional formatting documentation explicitly supports Field value formatting where a measure returns a colour name, hex code, or report-theme colour name.
The report theme documentation describes dataColors as the palette used for data colours, but I do not see any documented requirement saying that a uniformly conditionally formatted line must use the first entry in dataColors.
So the behaviour you reproduced does not appear to be an expected documented limitation.
Your test case is particularly useful:
- fixed line colour -> line renders
- conditional colour with all points returning the same colour and that colour equals dataColors[0] -> line renders
- conditional colour with all points returning the same colour but it differs from dataColors[0] -> markers remain, but the line stroke disappears
- changing one value/colour -> line renders again
- changing the theme so the returned colour becomes dataColors[0] -> line renders again
I would report this now rather than keep changing the DAX.
Microsoft has a dedicated Power BI Issues area specifically for reproducible product bugs. I would post the minimal PBIX there together with:
- Power BI Desktop version 2.157.879
- the minimal custom theme JSON
- the colour measure
- the exact steps above
- screenshots of the working and failing states
I would also use Power BI Desktop Help -> Report a problem and, if you have Microsoft support access, open a support case with the same minimal PBIX.
Microsoft's support-ticket guidance specifically recommends providing a simplified reproducible example and PBIX where possible, so the file you have built is exactly the type of evidence that should help the visual team investigate this.
As a temporary workaround, if only one uniform conditional colour is required, making that colour the first dataColors entry appears to work based on your testing. I would treat that only as a workaround, though, because it obviously does not scale if different states need different uniform colours.
I think this is worth reporting as a line-chart conditional-formatting/theme interaction rather than a data-model issue.
AI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.