Forum Discussion
dbehara
5 years agoFrequent Visitor
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...
- 5 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 regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic
dbehara
5 years agoFrequent Visitor
selimovd i got the columns now
But 'Yes' getting error (failed to resolve name 'Yes'. it is not a valid table,variable or function name.
selimovd
Most Valuable Professional
5 years agoHey 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
Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic