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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Conditional formatting for cards visual

Hello All,

 

I need to do conditional formating on below cards. When I select Total potential saving from the slicer, the data from cards total weighted and total actual should have to gray out and total potential should be darker.

similar when I select other field from slicer.

 

The cards are different measures.

Krutigawale33_0-1616133832968.png

Krutigawale33_1-1616133894957.png

 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download sample PBIX file

 

You might want to adjust the color for the selected value, it's currently light blue when selected.  I wasn't sure what you meant by 'darker' - the background or the font?  I think it stands out more as it is.

In the attached file are 3 measures to indicate if the associated card value is selected or not e.g.

TAS Color = IF(ISFILTERED('Table'[Savings]), IF(SELECTEDVALUE('Table'[Savings])="Total Actual Savings",1,0),2)

 

This is then used in a Conditioanl Formatting rule

cfr4.png

 

The color measures and rules are almost identical for the other 2.

 

cfcards.png

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

4 REPLIES 4
PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download sample PBIX file

 

You might want to adjust the color for the selected value, it's currently light blue when selected.  I wasn't sure what you meant by 'darker' - the background or the font?  I think it stands out more as it is.

In the attached file are 3 measures to indicate if the associated card value is selected or not e.g.

TAS Color = IF(ISFILTERED('Table'[Savings]), IF(SELECTEDVALUE('Table'[Savings])="Total Actual Savings",1,0),2)

 

This is then used in a Conditioanl Formatting rule

cfr4.png

 

The color measures and rules are almost identical for the other 2.

 

cfcards.png

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi @PhilipTreacy 

 

I tried this but I could not find where to set the conditional formatting on a card

I found that you can do it in tables and matrices.

 

walterdp_0-1673528500824.png

 

Anonymous
Not applicable

Thanks @PhilipTreacy  That's working.

amitchandak
Super User
Super User

@Anonymous , if you want to color car visual

 

if(selectedvalues(Slicer[value]) = "Total potential saving", "grey", "white")

 

You can use conditional formatting with field value option.

 

other examples

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"))

 

 

steps

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.