Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Related column and conditional column

hi all...

I have a column value using related.

for example, how do i create a column, if country has Asia, then "Asia" else "others"

 

I am not able to use conditional column? Any advice is grateful.

 

 

 

 

  • az38's avatar
    az38
    6 years ago

    Anonymous 

    try

    SWITCH(
    TRUE(),
    CONTAINSSTRING(Table[Country],"AsiaPac")=TRUE(), "AsiaPac",
    CONTAINSSTRING(Table[Country],"Asia")=TRUE(), "Asia",
    "Others"
    )

    do not hesitate to give a kudo to useful posts and mark solutions as solution

4 Replies

  • Hey Anonymous ,

    Hey You can try below one also,

    IF(CONTAINSSTRING(Table[Country],"Asia")=TRUE(),"Asia","Others")
    Regards,
    Snandy
    • Anonymous's avatar
      Anonymous
      Not applicable

      sanalyticsThanks,it work, i tried using 3 conditional but not sure how to do it.

      any idea

       

      condition1 - if table contain Asia - then asia

      condition1 - if table contain AsiaPac - then asiaPc

      else Others

      • az38's avatar
        az38
        Community Champion

        Anonymous 

        try

        SWITCH(
        TRUE(),
        CONTAINSSTRING(Table[Country],"AsiaPac")=TRUE(), "AsiaPac",
        CONTAINSSTRING(Table[Country],"Asia")=TRUE(), "Asia",
        "Others"
        )

        do not hesitate to give a kudo to useful posts and mark solutions as solution

  • az38's avatar
    az38
    Community Champion

    Hi Anonymous 

    it should be enough:

    Country = IF(FIND("Asia"),RELATED(CountryCode[Country])) > 0, "Asia", "Others")

    do not hesitate to give a kudo to useful posts and mark solutions as solution