Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
apoorvsi
Helper I
Helper I

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?

 

comm-pbi.PNG

5 REPLIES 5
amitchandak
Super User
Super User

@apoorvsi , 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-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

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?

DataZoe
Employee
Employee

@apoorvsi 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. 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

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?

Hi , @apoorvsi 

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

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.