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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
NJCLIFFORD
Frequent Visitor

Conditionally change colour of CARD

Howdy,

 

I have needed to change the colour of the field value in a CARD, which I know cannot be done at the moment. I downloaded the vizualisation 'Advance Card' which enables this to be done. Had it working and published, on the browser works perfectly. As I change filters, it changes from red to green as expected.

 

Now, when I download the PBIX file, and I select the field in Power BI Desktop, the highlighted vizualisation is the Card. I have the Advance Card installed and can see it on the list, but the field when selected highlights the Card icon. Also, when I look at Visual / Callout Value for the card under Color it just has the dropdown option for colour, and is defaulted to red (as default filter sets it to red). When I change the filter in Desktop, the colour changes to green as expected. Change again, goes back to red. 

 

The minute I click on the color dropdown box, when I change the filter it now does not change.....

 

Can someone explain what I am doing wrong??  Is ADvance Card the only 'easy' way to change the colour of a value??

 

Thanks


Nick

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@NJCLIFFORD,

 

You can achieve this with the native Card visual by using the measure below (use color codes or names):

 

Color Format = 
VAR vAmount = [Amount]
VAR vResult =
    SWITCH (
        TRUE,
        vAmount > 0, "Green",
        vAmount = 0, "Yellow",
        vAmount < 0, "Red"
    )
RETURN
    vResult

 

In the Card formatting options, set conditional formatting:

 

DataInsights_0-1663787414575.png

 

DataInsights_1-1663787428521.png

Result:

 

DataInsights_2-1663787448446.png

---

DataInsights_3-1663787471626.png

---

DataInsights_4-1663787489366.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
DataInsights
Super User
Super User

@NJCLIFFORD,

 

You can achieve this with the native Card visual by using the measure below (use color codes or names):

 

Color Format = 
VAR vAmount = [Amount]
VAR vResult =
    SWITCH (
        TRUE,
        vAmount > 0, "Green",
        vAmount = 0, "Yellow",
        vAmount < 0, "Red"
    )
RETURN
    vResult

 

In the Card formatting options, set conditional formatting:

 

DataInsights_0-1663787414575.png

 

DataInsights_1-1663787428521.png

Result:

 

DataInsights_2-1663787448446.png

---

DataInsights_3-1663787471626.png

---

DataInsights_4-1663787489366.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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