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
fandecine
Frequent Visitor

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 @fandecine,

 

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 @fandecine,

 

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
Super User
Super User

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

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!




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