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
blockobito
Helper I
Helper I

How to change the color of Number ( SLA ) Green, Amber, Red

How to change the color of Number ( SLA ) Green, Amber, Red?

how to change the color of a number when i reached a specific number 

For Example

 

0 - 3 = Green

4-7 = Amber

8 Above = Red 

 

1 ACCEPTED SOLUTION
v-yinliw-msft
Community Support
Community Support

Hi @blockobito ,

 

You can try this method:

New a measure:

 

Color =
VAR _numberselected =
    SELECTEDVALUE ( 'Table'[Number] )
VAR _AorR =
    IF ( _numberselected >= 4 && _numberselected <= 7, "#ffbf00", "Red" )
RETURN
    IF ( _numberselected >= 0 && _numberselected <= 3, "Green", _AorR )

 

Or you can use this method:

New a measure:

Colors =
VAR _num =
    SELECTEDVALUE ( 'Table'[Number] )
RETURN
    SWITCH (
        TRUE (),
        _num >= 0
            && _num <= 3, "Green",
        _num >= 4
            && _num <= 7, "#ffbf00",
        _num >= 8, "Red"
    )

And then in the visual of table , you can set the color like this:

Turn on the Font Color, here.

vyinliwmsft_0-1667551906268.png

 

And click the fx:

Select the field value in the format style, base on the measure created before:

vyinliwmsft_1-1667551906271.png

 

The result is:

vyinliwmsft_2-1667551906272.png

 

 

Is this what you expect?

Hope this helps you.

Here is my PBIX file.

 

Best Regards,

Community Support Team _Yinliw

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

View solution in original post

2 REPLIES 2
v-yinliw-msft
Community Support
Community Support

Hi @blockobito ,

 

You can try this method:

New a measure:

 

Color =
VAR _numberselected =
    SELECTEDVALUE ( 'Table'[Number] )
VAR _AorR =
    IF ( _numberselected >= 4 && _numberselected <= 7, "#ffbf00", "Red" )
RETURN
    IF ( _numberselected >= 0 && _numberselected <= 3, "Green", _AorR )

 

Or you can use this method:

New a measure:

Colors =
VAR _num =
    SELECTEDVALUE ( 'Table'[Number] )
RETURN
    SWITCH (
        TRUE (),
        _num >= 0
            && _num <= 3, "Green",
        _num >= 4
            && _num <= 7, "#ffbf00",
        _num >= 8, "Red"
    )

And then in the visual of table , you can set the color like this:

Turn on the Font Color, here.

vyinliwmsft_0-1667551906268.png

 

And click the fx:

Select the field value in the format style, base on the measure created before:

vyinliwmsft_1-1667551906271.png

 

The result is:

vyinliwmsft_2-1667551906272.png

 

 

Is this what you expect?

Hope this helps you.

Here is my PBIX file.

 

Best Regards,

Community Support Team _Yinliw

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

Hello i also found a solution by Conditional Formating  in the settings tab of the Text/Number of the Visual Pane. Thank You for answering! 

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.