Forum Discussion
if else with conditional formatting
- 3 years ago
Hi SalimTX ,
According to your description, I create a sample.
Here's my solution, create a measure.
Color = IF ( MAX ( 'Table'[KBB_value] ) <> 0 && MAX ( 'Table'[KBB_value] ) = MAX ( 'Table'[car_salvage_value] ), "Red", "Green" )As car_salvage_value and KBB_value are columns in my sample, I use MAX to reference the current value. IF they're measures in your model, you can remove the MAX in the code.
Then in the visualizations pane, select drop-down option of the column you want to change font color>Conditional formatting>Font color.
Select the measure in the dialog.
Get the result:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi SalimTX ,
According to your description, I create a sample.
Here's my solution, create a measure.
Color =
IF (
MAX ( 'Table'[KBB_value] ) <> 0
&& MAX ( 'Table'[KBB_value] ) = MAX ( 'Table'[car_salvage_value] ),
"Red",
"Green"
)
As car_salvage_value and KBB_value are columns in my sample, I use MAX to reference the current value. IF they're measures in your model, you can remove the MAX in the code.
Then in the visualizations pane, select drop-down option of the column you want to change font color>Conditional formatting>Font color.
Select the measure in the dialog.
Get the result:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- SalimTX3 years agoNew Member
Hi,
Thank you for your response!
We were able to make it work with two steps process however your suggestion would work.
Marking your reponse as an accepted solution