Forum Discussion

santiagoremon37's avatar
santiagoremon37
New Member
2 days ago

Wrong behaviour in conditional formatting for lines

There is an issue with the new conditional formatting for line color in line charts (Power BI Desktop August 2026, 2.157.879). When all values in the series are identical, the markers are displayed but the line between them is not drawn. If I remove the conditional formatting, or if the series contains at least one different value, the line renders correctly. Expected behavior: a flat continuous line. Steps to reproduce: 1) create a line chart with a measure returning the same value across all dates, 2) apply conditional formatting (fx) to the line color, 3) the line is not rendered.

How can I do to solve this?

 

 

5 Replies

  • ShivekMaharaj's avatar
    ShivekMaharaj
    Icon for Memorable Member rankMemorable Member

    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.

    • santiagoremon37's avatar
      santiagoremon37
      New Member

      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 :)

      • santiagoremon37's avatar
        santiagoremon37
        New 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?

  • Hi santiagoremon37​ - If the line does not require dynamic coloring, remove the conditional formatting and use a fixed series color.  If dynamic line coloring is required, you can temporarily consider using separate series/measures with fixed colors, depending on the business requirement. However, this is only a workaround; it does not address the underlying rendering issue.

    Can we apply conditional formatting to line colour in line chart? | Microsoft Fabric Community

    NOte: I would not recommend changing the DAX measure or data model as the solution. The evidence points to the line-chart rendering/conditional-formatting implementation.

    this is only a workaround; it does not address the underlying rendering issue. I would also recommend reporting this through Power BI Desktop >> Help >> Report a problem

    Hope this helps.