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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
idkwhatimdoing
Advocate I
Advocate I

DAX Dynamic Background Color Format for New Card Visual

I'm trying to create dynamic measure that changes the color of the card background depending on which measure is being evaluated in the new card visual. I have 6 measures/cards in this visual, so I wanted to use one color measure for the entire report. I've created the measure below and applied the formatting to card background, but I'm getting all cards the "else" statement color. It seems like I'm close. What am I missing?

Measure Color =
SWITCH(
    SELECTEDMEASURE(),
    [OB Empl FTE],"#0074D8",
    [Total Apprv FTE], "#6C757D",
    [Supv Position Count], "#003D72",
    [Active Posn Count],"#001845",
    [OB Empl Count],"#00223F",
    [Total Vacant Posns],"#FFBA08",
    [Internal Loss],"#FFBA08",
    [Total Loss M],"#E76F51",
    [External Loss],"#DC2F02",
    [Interagency Loss],"#6A040F",
    "#6A040F"
)
Format Pane:
idkwhatimdoing_1-1731521377254.png
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @idkwhatimdoing ,

 

I'm afraid a single multi-row card cannot be set with multiple colors at the same time. I would suggest using multiple card visuals instead, each with its own background color.

 

Best Regards,

Bof

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @idkwhatimdoing ,

 

I'm afraid a single multi-row card cannot be set with multiple colors at the same time. I would suggest using multiple card visuals instead, each with its own background color.

 

Best Regards,

Bof

idkwhatimdoing
Advocate I
Advocate I

@Pragati11 , Thank you for your response... let me try to clarify:

This is the new card visual with multiple measures. 

idkwhatimdoing_0-1731530882339.png

However, the background color of each card has been formatted by selecting a color for each measure, like so:

idkwhatimdoing_1-1731531600057.png

I want to be able to use one measure to format the background color of each corresponding measure. This is what I have, but all the cards are displaying as the same color: #6A040F.

Measure Color =
SWITCH(
    SELECTEDMEASURE(),
    [OB Empl FTE],"#0074D8",
    [Total Apprv FTE]"#6C757D",
    [Supv Position Count]"#003D72",
    [Active Posn Count],"#001845",
    [OB Empl Count],"#00223F",
    [Total Vacant Posns],"#FFBA08",
    "#6A040F"
)
Pragati11
Super User
Super User

Hi @idkwhatimdoing ,

 

I am not sure if I understand your question. What do you mean by measure evaluated in the card visual?

You can move multiple measures to a single card visual (NEW) like below:

Pragati11_0-1731530517464.png

 

I have moved 2 measures in this example and they both are evaluated in this nEW card visual as 2 differnt values.

What conditional formatting are you looking here as both measures will have some value ALWAYS in the NEW card visual?

 

Pease elaborate more with screenshots.

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors