Dynamically Hide a Card

Hello @rit372002,
Yes, you can conditionally hide a card in Power Bi based on field values

You need 2 DAX measures that should be formatted as TEXT:

  1. to conditionally format the font
Font Color Switch = 
    var a = SELECTEDVALUE('Table'[Value])
    RETURN
    SWITCH(
        true(),
        a=0,"#FFFFFF00",
        "252423")
  1. to conditionally format the background
Background Color Switch = 
var a = SELECTEDVALUE('Table'[Value])
RETURN
SWITCH(
    true(),
    a=0,"#FFFFFF00",
    "#A0D1FF")

The two measures will bring the HEX code #FFFFFF which corresponds to white, but what makes it transparent is the 00 at the end. If you use DAX you can add transparency directly in the code. :wink:

Then you have to go to FORMAT/ Data label / click on FX and choose your measure
and FORMAT/ Background/ click on FX and choose your measure

I created a sample ex for you,
Highlight invisible card.pbix (16.3 KB)

Best regards,
Alex

4 Likes