Forum Discussion
How to create if then statement in Power Query based on Error in value across three columns?
- Anonymous6 years ago
Hey Anonymous
You can use try/otherwise as shown in this thread: https://community.powerbi.com/t5/Desktop/Power-Query-M-code-equivalent-to-quot-iferror-quot-function/td-p/281479
You can follow the guidelines in this article: https://www.poweredsolutions.co/2019/06/18/error-handling-iferror-in-power-bi-power-query/
You can use the Find & replace in the Query Editer in Power BI which will add a step to the query to replace errors with a string of your choosing.
Or you can use a calculated column with the IFERROR function: https://docs.microsoft.com/en-us/dax/iferror-function-dax
If this helps please kudo.
If this solves your problem please accept it as a solution.
Hi Anonymous
use "Replace Error" option. rigth-click to data column and replace error values to "0"
then use statement like
= if [Clean Date 2] = 0 then [Clean Date 3] else if .. then ... else ...