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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Conditional formatting

Hi,

I have a measure Delta as follow:

Delta = SWITCH(
    TRUE(),
    [Hours_Submitted_TS] - [Hours_Forecast] > 0, "Charged more than expected",
    [Hours_Submitted_TS] - [Hours_Forecast] < 0, "Charged less than expected",
    [Hours_Submitted_TS] - [Hours_Forecast] = 0, "Charged as forecasted"
    )
 
I put this measure in a table and would like to change colors depending on the text.
Since this is not based on a field (also using 2 more measures9 , I don't see how to do it.
Thanks for your help.
LD
1 ACCEPTED SOLUTION
_AAndrade
Super User
Super User

Hi @Anonymous,

 

You can use a measure to define the color like this:

Delta Color= SWITCH(
    TRUE(),
    [Delta ] = "Charged more than expected", "RED",
     [Delta ] = "Charged less than expected", "YELLOW",
    [Delta ] = "Charged as forecasted", "GREEN"
    )

Then go to Format Ribon and follow the path indicated by @ChiragGarg2512., like this:
_AAndrade_3-1713428024591.png

 

_AAndrade_2-1713427956587.png

 





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

6 REPLIES 6
_AAndrade
Super User
Super User

Hi @Anonymous,

 

You can use a measure to define the color like this:

Delta Color= SWITCH(
    TRUE(),
    [Delta ] = "Charged more than expected", "RED",
     [Delta ] = "Charged less than expected", "YELLOW",
    [Delta ] = "Charged as forecasted", "GREEN"
    )

Then go to Format Ribon and follow the path indicated by @ChiragGarg2512., like this:
_AAndrade_3-1713428024591.png

 

_AAndrade_2-1713427956587.png

 





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




@_AAndrade Thanks for the correction.

ChiragGarg2512
Solution Sage
Solution Sage

Go to Format Visual -> Cell Element -> Background Color -> Field[Format Style] -> Select the measure.

Anonymous
Not applicable

Hi,

Well, nothing happens.

I have

Format style: Field value

Apply To: Values only

What field: Delta

You need to choose What field: Delta Color (the new measure)





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




Anonymous
Not applicable

Hi,

The formatting is working fine showing correct values either in red or green.

However, when I publish my report on the BI Server, all my values show as red (tables and cards)!

Any idea why? We have BI server Jan 2023.

Thx. 
LD

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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