Forum Discussion
Ekaterina
9 years agoRegular Visitor
IF condition
Hello, could anyone tell me what is wrong with the following statement: Column = IF Query[CR] = NaN then 0 else Query1[CR] Thank you, Ekaterina
Anonymous
9 years agoNot applicable
Ekaterina
9 years agoRegular Visitor
Anonymous well I select Query1[CR] as Power BI advices me in the bar so it knows from which query am I selecting CR. I have tried to replaced IF for if and tried both without Query1 and with it, but it returns me an error anyway. It says that ''the syntax for ´then´ is incorrect. (DAX(IF (Query1[CR] = NaN then 0 else Query1[CR]))).''
- Anonymous9 years agoNot applicable
Your Query seems to be a DAX Query..
MarcelBeugand I posted you Power Query solutions (I have to admit, that only MarcelBeug solution works, as I've overlooked the NaN issue....)..
- Eric_Zhang9 years agoMicrosoft Employee
MarcelBeug's reply should work for Power Query.
For DAX you can try
Column = IF(Query[CR]="NaN","0",Query[CR]) or Column 2 = IF(ISBLANK(Query[CR]),"0",Query[CR])