Forum Discussion
lbrown
8 years agoHelper I
How Do I Write This IF Error Statement in Power Query & Power BI Desktop
I have the following formula in an excel sheet =IFERROR(IF(V2="",0,IF(W2<>"",W2-T2,Lookups!$L$1-T2)),0) and it does a vlookup to another tab with the prior date. In Power Query I now have a column th...
- Anonymous8 years ago
HI lbrown,
You can take a look at below links about error handling in dax and m query:
For your measure, it can be transform as below measure:
Result = VAR prior = xxxx VAR V2 = xxx VAR W2 = xxx VAR T2 = xxx RETURN IFERROR ( IF ( V2 = "", 0, IF ( W2 <> "", W2 - T2, prior - T2 ) ), 0 )I'm not clear how you get these variables, so I use var function to define them as variables .
Regards,
Xiaoxin Sheng
Anonymous
8 years agoNot applicable
Hi lbrown,
My formula is dax version, it not works for power query. You also need to input variable before use it..
Regards,
Xiaoxin Sheng
lbrown
8 years agoHelper I
Hi Xiaoxin,
I didn't realize your formula was the Dax version, but I used this formula and included the correct column names for the variables and this worked. Thanks for your help.
Best,
Lauren