Forum Discussion
Conditional formatting in power bi
- Anonymous3 years ago
Hi Anonymous,
The rule mode conditional formatting may not work properly when handling the aggregate values of the value field.
For this scenario, you can consider using expression-based conditional formatting:
Apply conditional table formatting in Power BI - Power BI | Microsoft Learn
You only need to write a measure formula to extract and summary the current value field value and use it as often in the if statement to return color codes.
formula = VAR currValue = SUM ( Table[Amount] ) RETURN IF ( currValue > 0.85, "Green", IF ( currValue >= 0.8, "Yellow", "Red" ) )Regards,
Xiaoxin Sheng
Hi Anonymous,
The rule mode conditional formatting may not work properly when handling the aggregate values of the value field.
For this scenario, you can consider using expression-based conditional formatting:
Apply conditional table formatting in Power BI - Power BI | Microsoft Learn
You only need to write a measure formula to extract and summary the current value field value and use it as often in the if statement to return color codes.
formula =
VAR currValue =
SUM ( Table[Amount] )
RETURN
IF ( currValue > 0.85, "Green", IF ( currValue >= 0.8, "Yellow", "Red" ) )
Regards,
Xiaoxin Sheng