Forum Discussion
Anonymous
7 years agoNot applicable
DAX if statement syntax error
I am new to Power BI ... I am tyrying to insert a new custom column into a table in the Query Editor. The Column should extract data from an excisting column based on an "IF" Statement with an "CONTA...
- 7 years ago
Anonymous Please note "Power Query" expressions are case sensitive. "IF" not same as "if", please correct the all keywords in your expression.
PattemManohar
7 years agoCommunity Champion
Anonymous Please try this..
=IF (CONTAINS(TableName,[Content],"SHOWS"),"SHOWS",IF ([Content] IN {"DRY","WATER"},"DRY","HC"))Note - CONTAINS will return TRUE if there is any row in the table that contains SHOWS in the Content field. Not sure whethere you want that behaviour or looking for searching in each row then try this
IF(SEARCH("SHOWS",[Content],1,0)>0,"SHOWS",IF(Test140[Content] IN {"DRY","WATER"},"DRY","HC"))