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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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