Forum Discussion

idkwhatimdoing's avatar
idkwhatimdoing
Advocate I
1 year ago
Solved

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:
  • Anonymous's avatar
    Anonymous
    1 year ago

    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

3 Replies

  • 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:

     

    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.

     

  • Anonymous's avatar
    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

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

    This is the new card visual with multiple measures. 

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

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