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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sibincube89
Regular Visitor

Conditional Formatting Text color legend

What is the best way to have conditional formatting assigned to the text portion of a BI graph?
Below is what is currently built to work as conditional color formatting for data cards (And it works well for individuals selections). But, since each of the categories have various criteria they are required to meet, the combination of the two is proving to be over my head. Any advice would be greatly appreciated!

I want to someone combine the two DAX below:

 

Conditional Color - CIV =
SWITCH(
TRUE(),
[Adj FYDP UMD %] = BLANK(),BLANK(),  
MeasureTable[Adj FYDP UMD %] > -0.00125 && MeasureTable[Adj FYDP UMD %] <= 0.00125, "#32A846",
MeasureTable[Adj FYDP UMD %] > 0.0025 && MeasureTable[Adj FYDP UMD %] <= 1.000, "#F22917",
MeasureTable[Adj FYDP UMD %] > -1.000 && MeasureTable[Adj FYDP UMD %] <= -0.0025, "#F22916",
"#F7FA34")

 

Conditional Color - OFF/ENL =
SWITCH(
TRUE(),
[Adj FYDP UMD %] = BLANK(),BLANK(),  
MeasureTable[Adj FYDP UMD %] > -0.005 && MeasureTable[Adj FYDP UMD %] <= 0.005, "#32A846",
MeasureTable[Adj FYDP UMD %] > 0.015 && MeasureTable[Adj FYDP UMD %] <= 10.00, "#F22917",
MeasureTable[Adj FYDP UMD %] > -10.00 && MeasureTable[Adj FYDP UMD %] <= -0.015, "#F22916",
"#F7FA34")

 

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @sibincube89 

 

There is some conflict between the two formulas, do you see if this is the result you expect?

Color Measure = SWITCH(TRUE(),
[Adj FYDP UMD %]>-10    && [Adj FYDP UMD %]<=-0.005,"#F22916",
[Adj FYDP UMD %]>-0.005 && [Adj FYDP UMD %]<= 0.005,"#32A846",
[Adj FYDP UMD %]> 0.005 && [Adj FYDP UMD %]<= 10,"#F22917",
"#F7FA34")

vzhangti_0-1682563803721.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello, @v-zhangti The reason the two sets of DAX are different is due to the driving categories having different metrics.

CIV:

> -1.25% & <= 1.25% is considered "Green"

> 2.5% & <= 100% is considered "Red"

> -100% & <= -2.5% is considered "Red"

All others "Yellow"

 

OFF/ENL:

> -0.5% & <= 0.05% is considered "Green"

> 1.5% & <= 100% is considered "Red"

> -100% & <= -1.5% is considered "Red"

All others "Yellow"

 

I have these two conditional color formatting options working perfectly within data cards, but trying to combine the two into a single measure to work for text in a visual is not working. 

 

Any other ideas? 

 

Thanks! 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors