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
jeongkim
Helper V
Helper V

Change the color of measure value & add symbol with conditions

Hi,

 

Can we change the color of variance measure in blue(data lable-detail) into Green(#57A46B) for positive and Red(#C13F31) for negative?

But without making dax columns for color codes, just making in one or minimum measure to change the color of value itselt?

Plus, wish to add symbol or +- as well if it is possible.  

 

e.g.

current: 13 21 -137 -15

desired: +13 +21 -137 -15 or ▲13 ▲21 ▼137 ▼15(prefer)

 

jeongkim_0-1711441478627.png

 

 

4 REPLIES 4
Uzi2019
Super User
Super User

Hi @jeongkim 
Yes. You can change the color code of data label. but you have to write dax for green and red color.
But you dont need to write calculted columns. just simple 2 measures would work for you.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Hi,

what is the 2 simple measures?

Idrissshatila
Super User
Super User

Hello @jeongkim ,

 

check this https://youtu.be/o2jSUHU722w?si=GNIrK-OGGImvSsJu

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Hi,

 

Thanks it helps but can you take a look at my measure a bit more pls?

2 things to improve:

 

1. percentage format ##.##% shows only after . 
    e.g. +.3% shoud be +0.3%

2. hope to change the text color and size for inside bracket text.

    e.g. ▲10 (+0.15%)

 

 

 

Measure =
    VAR
        _difference = [vs Last Week]
    VAR
        _direction =
            SWITCH(
                TRUE()
                , _difference > 0, "▲"
                , _difference < 0, "▼"
                , "-"
            )

    VAR
        _direction2 =
            SWITCH(
                TRUE()
                , _difference > 0, "+"
                , _difference < 0, "-"
                , "-"
            )
    VAR
        _percentchange =
            _difference / [Last Week Count of $dn]
    RETURN
        _direction & " " & _difference & " (" & _direction2 & FORMAT(_percentchange, "##.##%") & ")"

Measure 2 =
    VAR
        _difference = [vs Last Week]
    RETURN
            SWITCH(
                TRUE()
                , _difference > 0, "#57A46B"
                , _difference < 0, "#C13F31"
                , "#FFFFFF"
            )
 
 
 
jeongkim_0-1711502747788.png

 

 

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.