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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.