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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors