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
Thanks for help 🙂
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
6 Replies
- selimovdMost Valuable Professional
Hey dbehara ,
Power BI is not Tableau, what is the reason I asked where exactly you need that.
In this case I can just guess. An approach for a calculated column would be:
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