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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Janica123
Helper I
Helper I

Conditional Format Data Lables Field Value

Hi,
I'm trying to conditionally format the data lable of a column chart, based weather the value is positive (green) or negative (red)

However, when trying to format based on 'Field Value', the dropdown box for 'What field should we base this on?' is outlined red, and it doesn't let me select my measure.

This is how my measures looks like:

 

%Change_Tagessatz =
VAR Change =
DIVIDE(
[Ø Tagessatz] - [Ø Tagessatz_LY],
[Ø Tagessatz_LY]
)

RETURN
FORMAT(Change, "0.0%")

 

%Change_Tagessatz_Color = IF( [%Change_Tagessatz] > 0, "Green", "Red")

 

In the dropdown box I want to put the 2. measure (%Change_Tagessatz_Color)

Any ideas?

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @Janica123 -You need to create a measure that returns a numeric or color code value. The best approach is to use color codes (Hex or RGB) instead of text

 

link:

Color Hex Color Codes (color-hex.com)

 

%Change_Tagessatz_Color =
IF(
    [%Change_Tagessatz] > 0,
    "#00FF00",   // Green in Hex
    "#FF0000"    // Red in Hex
)

 

 

rajendraongole1_0-1724438246842.png

 

This measure returns the Hex color code for green when the value is positive and red when the value is negative.In the "Based on field" dropdown, select your measure.

 

Hope it helps.

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
gmsamborn
Super User
Super User

Hi @Janica123 

 

I noticed a problem with your measures.

When you format the result using FORMAT, it returns a text value which you won't be able to compare to zero in your second measure.

Format the measure using the formatting ribbon if required.



Proud to be a Super User!

daxformatter.com makes life EASIER!
rajendraongole1
Super User
Super User

Hi @Janica123 -You need to create a measure that returns a numeric or color code value. The best approach is to use color codes (Hex or RGB) instead of text

 

link:

Color Hex Color Codes (color-hex.com)

 

%Change_Tagessatz_Color =
IF(
    [%Change_Tagessatz] > 0,
    "#00FF00",   // Green in Hex
    "#FF0000"    // Red in Hex
)

 

 

rajendraongole1_0-1724438246842.png

 

This measure returns the Hex color code for green when the value is positive and red when the value is negative.In the "Based on field" dropdown, select your measure.

 

Hope it helps.

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.