Forum Discussion
nick-evans
8 years agoAdvocate I
How can I use an OR function inside an IF statement in PowerQuery?
I am using Power BI Desktop, and I have imported a table from a SQL Database. I am under 'Data | Edit Query | Add Column | Custom Colunn', and having problems getting my formula to work. I would li...
- 8 years ago
Hi nick-evans,
Try this formula please.
=if [NAME] = "Nick" or [NAME] = "Sally" then "true" else "false"
Reference: https://msdn.microsoft.com/en-us/library/mt186365.aspx
Best Regards!
Dale
bazeemuddin
7 years agoFrequent Visitor
Greetings.
I used this to create a new col using IF and OR
Num_Days = IF((Tickets[Status] = "CLOSED") || (Tickets[Status] = "RESOLVED"),
DATEDIFF('Tickets'[Reported Date], 'Tickets'[Actual Finish], DAY),
DATEDIFF(Tickets[Reported Date], TODAY(), DAY))
Thanks for reading.
Wish you all the happiest time.