Forum Discussion

sonuojha1's avatar
sonuojha1
Icon for Helper IV rankHelper IV
5 years ago
Solved

How to use text columns in Measure?

Hello All,   I have a small scenario, where I would like to group the nationality into below categories. If Nationality="Indian" then "A1" if Nationality = "Australian" then "A2" If Nationality ...
  • MFelix's avatar
    5 years ago

    Hi sonuojha1 ,

     

    You can add the following measure:

    Nationality group =
    SWITCH (
        SELECTEDVALUE ( Table[Nationality] ),
        "Indian", "A1",
        "Australian", "A2",
        "American", "A3",
        "Other"
    )

     

    Be aware that being a measure you need to have the nationality on your visualization otherwise these will not work properly, further more since it's a measure you cannot use it has a axis on visualizations or columns in a matrix visualization.

     

  • sonuojha1's avatar
    sonuojha1
    5 years ago

    Thanks Miguel. 

    I have noted your comment. 

     

    Regards,

    Sonu