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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Thulasiram
Helper II
Helper II

Formatting custom data lable through dax

Hi all

I have created a bar chart and applied custom label through measure described below:

FORMAT([Erp Invoice]/100000, "0" & " L" & " | ") & FORMAT([ERP Inv%], "0.0%" & " | ") & "(" & FORMAT([Avg Inv Rate],"0")&")"
It consists three parts as below:
 
Screenshot 2023-07-25 055429.png
I would like the apply different colors to the above three categories of labels thro conditional formatting.
Can it be achieved by creating DAX and applying in conditional formatting?  If so, can anybody help me in giving that Dax?
Help is much appreciated.
 
Thulasiraman
 
 
2 REPLIES 2
amitchandak
Super User
Super User

@Thulasiram , The label can conditional formatting for each row of data not the partial one.

 

You can create a measure like

if([Avg Inv Rate]<.05, "red", "green")

 

and use that in conditional formatting (Fx on color) using field value option

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you @amitchandak for your reply and suggestion.

I tried that if formula as suggested by you, but it is not working.

Is it due to the reason that the custom label contain 3 parts of data but the if formula contains only 1 part of the custom label?

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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