How expert, I have a textbox control in the RDLC report, which has expression as (sum A/sum B)*100.
But when B is equal to zero, X will be showing ERROR since it is divided by zero exception.
I have tried the following in the textbox control expression, but it still shows error for those when B is zero. Please advise! Thank you!


Try this:

= IF( ISERROR( SUM('ResellerSales_USD'[SalesAmount_USD]) /SUM('InternetSales_USD'[SalesAmount_USD]) )
    , BLANK()    , SUM('ResellerSales_USD'[SalesAmount_USD])   /SUM('InternetSales_USD'[SalesAmount_USD])  )


IIf statement is tricky because preparing the argument list the compiler calls every function in every expression, so it’s not possible to rely on “else” part not being executed. To avoid this it’s possible to use a nested IIf, such as: