Forum Discussion
Tomhayw
3 years agoHelper 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 ...
- Anonymous3 years ago
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_colorSet font color:
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.
Anonymous
3 years agoNot 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:
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.
Tomhayw
3 years agoHelper I
Thanks, is there a way to do this with background colour instead of font colour?
Thanks,
Tom