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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Change conditional formatting values based on slicers

Hi All, 

 

I cant share data on this one due to GDPR but hopefully someone can help. 

 

I have a report that uses the conditional formatting for card background colour but I need the values to change based on a slicer selection.

 

For example, If its one team selected in the slicer,  I need green background colour for say 85% and below on the card visulisation. But other teams need to green only for 15% and below but amber or red above 15%. 

 

Is there a way to do this?

 

Many Thansk in advance!

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

You can create a measure to get the selected value of slicer and set a rule for conditional formatting.

For example:

Measure = IF(SELECTEDVALUE('Table'[teams])="A",1,0)

5.PNG

6.PNG

7.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

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 @Anonymous ,

 

You can create a measure to get the selected value of slicer and set a rule for conditional formatting.

For example:

Measure = IF(SELECTEDVALUE('Table'[teams])="A",1,0)

5.PNG

6.PNG

7.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , you can create a color measure that can include the value from slicer too and return a color

 

like

Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red")
Color Year = if(FIRSTNONBLANK(Table[Year],2014) <=2016,"lightgreen",if(FIRSTNONBLANK(Table[Year],2014)>2018,"red","yellow"))

 

In conditional formatting use the "field" option and this measure

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column

 

How to deal with a slicer value

https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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