Forum Discussion

dbehara's avatar
dbehara
Frequent Visitor
4 years ago
Solved

IF and CASE statement

Hi All,   Could anyone please help me with below query on power bi, the query im using on tableau   IF NOT ISNULL([task id]) THEN (CASE [activity] WHEN 'Yes' THEN 1 ELSE 0 END) ELSE 0 END   Tha...
  • selimovd's avatar
    selimovd
    4 years ago

    Hey dbehara ,

     

    sorry, that was my mistake. You have to use the double quotes.

    Try this one:

    New column =
    SWITCH(
        TRUE(),
        myTable[task id] = BLANK(), 0,
        myTable[activity] = "Yes", 1,
        0
    )

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis