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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.


Colour coded card based on the filter clicked



My problem here is i want to set the colour to my card based on the sales target of business unit. 


For example:

BU     | Sales Target

A       | 100

B       | 150


My card here shows the Sales number by whole at default. If i clicked the filter BU A, if the Sales number is higher than the target (100), the colour will be green, same as BU B. If lower than the colour is red.


If the filter is "all", the colour should be green if both A AND B passed the target. But the colour should be red if any A OR B below the target.


I have tried a few ways with SELECTEDVALUE and SWITCH functions but this one is out of my reach. Can anyone assist me on this matter?

Super User
Super User

@aidelapplicate , Based on what I got.

If sales and target are measure or create measures


then you can have color measure

color = if([sales]>[Target], "Green", "Red")


You can use the above measure in conditional formatting using the field value option


How to do conditional formatting by measure and apply it on pie?

Helpful resources


Fabric certifications survey

Certification feedback opportunity for the community.


Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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