Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Switch(SelectedValue Help

Hello - I am trying to write a what I think is a simple dax statement however I always end up with an error. I looked at a blog which provides the same type of logic however I cannot get mine to work. Please Help, what am I doing wrong?

 

SWITCH(SELECTEDVALUE(SAMPLE_TABLE[PROJECT_HEALTH],"Red","Red","Green","Green",BLANK(),"Complete", ""))

 

Thanks for any help!

  • SWITCH(
        SELECTEDVALUE( SAMPLE_TABLE[PROJECT_HEALTH] ),
        "Red", "Red",
        "Green", "Green",
        BLANK(), "Complete",
        ""
    )

2 Replies

  • CNENFRNL's avatar
    CNENFRNL
    Community Champion
    SWITCH(
        SELECTEDVALUE( SAMPLE_TABLE[PROJECT_HEALTH] ),
        "Red", "Red",
        "Green", "Green",
        BLANK(), "Complete",
        ""
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you so much. Something so easy and I seem to still struggle.