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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Tomhayw
Helper I
Helper I

Conditionally formatting different columns based on the same values

Hi there,

 

I currently have a matrix with months as rows, job grades as columns and utilisation as the values. 

I want to conditionally format this so that lower utilisation is red and higher is green however the target utilisation for each grade is different.

Is there a way to set different conditional formatting rules for each column?

 

Thanks,

Tom

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Tomhayw ,

Please try to create a measure with below dax formula:

Measure =
VAR cur_level =
    SELECTEDVALUE ( 'Table'[Level] )
VAR cur_val =
    SELECTEDVALUE ( 'Table'[Value] )
VAR val =
    SWITCH ( cur_level, "L1", 15, "L2", 30, "L3", 40 )
VAR fnt_color =
    IF ( cur_val >= val, "green", "red" )
RETURN
    fnt_color

Set font color:

vbinbinyumsft_0-1687760690832.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
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
Anonymous
Not applicable

Hi @Tomhayw ,

Please try to create a measure with below dax formula:

Measure =
VAR cur_level =
    SELECTEDVALUE ( 'Table'[Level] )
VAR cur_val =
    SELECTEDVALUE ( 'Table'[Value] )
VAR val =
    SWITCH ( cur_level, "L1", 15, "L2", 30, "L3", 40 )
VAR fnt_color =
    IF ( cur_val >= val, "green", "red" )
RETURN
    fnt_color

Set font color:

vbinbinyumsft_0-1687760690832.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks, is there a way to do this with background colour instead of font colour?

 

Thanks,

Tom

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.