Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Power BI format X-axis text color for different elements

Hi all,

 

I have a requirement where in I have to color the X-axis element "More than 20 days" with red color. Please note, I do not have to color the bar red. Instead, just the text in the axis. Rest all other elements should stay black. Is it possible?

 

5 Replies

  • DataZoe's avatar
    DataZoe
    Icon for Microsoft Employee rankMicrosoft Employee

    Anonymous I don't think this is possible directly, as in specify that one to be red.  But you can create a text box and format it how you like with a white background and overlay it over that bar label. 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks DataZoe 

      I have a limitation when using a text box. The categories are not fixed and are showen/hidden based on the count.

      So positioning of text box cannot be static.

      Is there any way I could make it dynamic?

      • v-easonf-msft's avatar
        v-easonf-msft
        Icon for Community Support rankCommunity Support

        Hi , Anonymous 

        Dynamic text box or  X-axis  text colors for different elements is not supproted  yet currently  in Power BI.

        For your requirement , you can come up with a new idea and add your comments there to make this feature coming sooner. https://ideas.powerbi.com/forums/265200-power-bi-ideas 

         

        Best Regards,
        Community Support Team _ Eason

         

  • Anonymous , Try like this will work when you are not using legend . Create a measure like

    color measure = if(FIRSTNONBLANK(Table[Calegory],"NA")= "More than 20 Days","red","green")
    
    color measure = if(max(Table[Calegory])= "More than 20 Days","red","green")

     

    Table[Calegory] is your x-axis

     

    Then in conditional formatting choose the field and this measure.

     

    Color Field - Color Measure - Conditional formatting
    https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
    https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for you answer, amitchandak 

       

      I am however unable to add conditional formatting on my column chart. I do not get the option at all for it.

      The link you included explains it for a table.

       

      Am I missing something here?