Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago

COLOR CAPTION

To set the color of the columns, I directed a DAX, which is working.
However, in the caption, the color is not the same as the column.
The column is black, but in the caption it is blue.
I'd like to know why.

 

3 Replies

  • adudani's avatar
    adudani
    Memorable Member

    hi Anonymous ,

     

    If you'd like to change the whole series color to a single column, conditional formatting is not required. 

     

    In this case, you could just select the series under "format -> column -> selected series -> bar color".

     

    conditional formatting is used to highlight the specific condition/ outliers in the trend specifically.

     

    The legend reflects the color of the column / series.

     

    Hope this helps.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Yes I understand, but in my case, I need the conditional formatting, as I have 4 different situations, where the color should change, and I don't have those situations in one column.
      Because of this, I need to use conditional formatting.
      The rule is:
      ID=1 and Status=F
      ID=1 and Status=P
      ID=2 and Status=F
      ID=1 and Status=P

      DAX:

      CorPreenchimento_K =

      SWITCH(

          TRUE(),

          SELECTEDVALUE('MODELO DADOS'[ID_EMP]) = 1 && SELECTEDVALUE('MODELO DADOS'[STATUS]) = "F", "#F29100",

          SELECTEDVALUE('MODELO DADOS'[ID_EMP]) = 1 && SELECTEDVALUE('MODELO DADOS'[STATUS]) = "P", "#000000",

          SELECTEDVALUE('MODELO DADOS'[ID_EMP]) = 2 && SELECTEDVALUE('MODELO DADOS'[STATUS]) = "F", "#BB0000",

          SELECTEDVALUE('MODELO DADOS'[ID_EMP]) = 2 && SELECTEDVALUE('MODELO DADOS'[STATUS]) = "P", "#000000",

          "#000000"

      )

      I have both filters on the screen, according to the filters the color should change.
      The DAX is working correctly, the colors are changing, but in the legend it does not change, it remains blue.

       



      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

         

        As Avinash mentioned, conditional formatting is used to highlight specific conditions/outliers in a trend. 

        This means that usually in a category the conditional format may have more than one color, but a category can only have one color, which is why it is difficult for the color of the legend to change dynamically along with the color of the bar chart.

         

        You can submit the idea here:

        Welcome to Microsoft Fabric Ideas

         

        Best Regards,
        Gao

        Community Support Team

         

        If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
        If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

        How to get your questions answered quickly --  How to provide sample data in the Power BI Forum