Forum Discussion

alisoroush7's avatar
alisoroush7
Helper I
3 years ago

using custom label

Hi

I created a dax and I write the below code in it:

CSI Emoji =
VAR AvgValue1 = CALCULATE(COUNT(Survey[A]),FILTER(Survey,Survey[A] >= 4)) / COUNT(Survey[A])
RETURN
    SWITCH(TRUE(),
        AvgValue1 >= 0.8, "๐Ÿ˜Š",        
        AvgValue1 >= 0.4, "๐Ÿคจ",
        AvgValue1 >= 0, "๐Ÿคฌ" 
    )
 
when i drop this dax to show the emojis as label of a line chart it changed numbers like in the below picture:
how can i fix this?

3 Replies

  • mlsx4's avatar
    mlsx4
    Memorable Member

    Hi, 

    Try to put your emoji by using UNICHAR(numb emoji)

    You can check the unichar here (https://blog.iwco.co/2018/09/11/como-agregar-emojis-a-power-bi/)

     

    CSI Emoji =
    VAR AvgValue1 = CALCULATE(COUNT(Survey[A]),FILTER(Survey,Survey[A] >= 4)) / COUNT(Survey[A])
    RETURN
        SWITCH(TRUE(),
            AvgValue1 >= 0.8, UNICHAR(128522),        
            AvgValue1 >= 0.4, UNICHAR(129320),
            AvgValue1 >= 0, UNICHAR (128545)
        )

     Something like this (check which is the emoji you want and replace the number inside)

    • alisoroush7's avatar
      alisoroush7
      Helper I

      i dit it but it still shows the number. does it related to font or anything else?

      • mlsx4's avatar
        mlsx4
        Memorable Member

        Okey, I understand... I don't think the font is the problem (If you change it nothing happens). But I'm afraid I can't help you this time. It will be interesting to see if someone could help.