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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Roinka
Helper I
Helper I

Color visualization of numbers at column level

Hi,

I have a matrix of 2 rows and several columns.

Each cell present a diff value. I would like to visualize the values with colors. The colors should diverge from red (bad) to blue (good).

However on Some columns a large no is good (blue) and on others a large no is bad (red).

I would like the colors to be at column level, that is if in this column a high number is good than a high number would be blue and if in this column high is bad than high would be in red.

Category, revenue, customers leaving

CategoryA, 4% (red), 5% (blue)

CategoryB, 60%(blue), 80% (red) 

Is this possible?

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

Hi @Roinka ,

 

We can set the font color conditional formatting based on a measure as below.

Color =
VAR L =
    FILTER ( ALL ( 'table' ), 'table'[TYPE] = "LEVING" )
VAR R =
    FILTER ( ALL ( 'table' ), 'table'[TYPE] = "REVENUE" )
RETURN
    SWITCH (
        TRUE (),
        SUM ( 'table'[VALUE] ) = MAXX ( L, [VALUE] ), "#FF0000",
        SUM ( 'table'[VALUE] ) = MINX ( L, [VALUE] ), "#0000FF",
        SUM ( 'table'[VALUE] ) = MINX ( R, [VALUE] ), "#FF0000",
        SUM ( 'table'[VALUE] ) = MAXX ( R, [VALUE] ), "#0000FF",
        "#FFFFFF"
    )

1.png2.png3.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

1 REPLY 1
v-frfei-msft
Community Support
Community Support

Hi @Roinka ,

 

We can set the font color conditional formatting based on a measure as below.

Color =
VAR L =
    FILTER ( ALL ( 'table' ), 'table'[TYPE] = "LEVING" )
VAR R =
    FILTER ( ALL ( 'table' ), 'table'[TYPE] = "REVENUE" )
RETURN
    SWITCH (
        TRUE (),
        SUM ( 'table'[VALUE] ) = MAXX ( L, [VALUE] ), "#FF0000",
        SUM ( 'table'[VALUE] ) = MINX ( L, [VALUE] ), "#0000FF",
        SUM ( 'table'[VALUE] ) = MINX ( R, [VALUE] ), "#FF0000",
        SUM ( 'table'[VALUE] ) = MAXX ( R, [VALUE] ), "#0000FF",
        "#FFFFFF"
    )

1.png2.png3.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.