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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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