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
Anonymous
Not applicable

swtich 1 green 0 red else blank no color

Hi , 

Can someone please make a formula for me. 

If the calue is 1 then its green, if its 0 then its red. And if none of those are selected nothing shows it blank

KPI value = var color=SELECTEDVALUE([on / off])
return
SWITCH(TRUE(),
    color="green",1,
    color="red",0,
    color= ''blank'',)
   

UNICHAR(11044)


value comminty.PNG
I want his as a big circle, and not in a table for condotional formatting
1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous ,

 

I didn't find the corresponding unicode for green circle, I inserted blue circle instead.

 

Please add below measure into a card visual.

KPI value =
IF (
    ISFILTERED ( Table1[On/Off] ),
    IF (
        SELECTEDVALUE ( Table1[On/Off] ) = 1,
        UNICHAR ( 128308 ),
        UNICHAR ( 128309 )
    ),
    BLANK ()
)

1.png2.png3.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous ,

 

I didn't find the corresponding unicode for green circle, I inserted blue circle instead.

 

Please add below measure into a card visual.

KPI value =
IF (
    ISFILTERED ( Table1[On/Off] ),
    IF (
        SELECTEDVALUE ( Table1[On/Off] ) = 1,
        UNICHAR ( 128308 ),
        UNICHAR ( 128309 )
    ),
    BLANK ()
)

1.png2.png3.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

My fault, I meant just white. That nothing shows at all, just plain white. Then when you click it changes. So the kpi card is just white, when you click on either 0 or 1 the colors will change. 

Hi @Anonymous ,

 

Still use above measure formula, then, turn off "Category Label", and set the color of "Data Label" to be the same as card's background.

1.png

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.