# SSRS calculation problems

### Question

• Hello Experts,
I have a SSRS reports that displays weekly sales and Store inventory levels. In this report, I have used a calculated member named "Branch Stock Value". And its expression is:

```Fields!Store_Stock_Level.Value *(Fields!PS.Value - ((Fields!PS.Value * Fields!VAT_Rate.Value)/100))
```

Now, I would like to use another calculated member that uses this BranchStockValue member. My desires calculated member expression is:

BranchStockValue / SalesValue

I get divide by zero or other null errors. But the final purposed result is really very easy.

For example for the first line Branch Week Cover value should be 12544.36 / 1656.39 =  7.57

Sunday, October 17, 2010 12:39 AM

• Hi.

For divide by zero error you can use iff statement in the expression where you are populating the " BranchStockValue / SalesValue"

For example :

here your SalesValue should not be zero since that is your denominator, write an expression some thing like this :

iif(condition,true,false)

iif(Fields! SalesValue.value = 0,"0", (Fields!BranchStockValue.value / Fields!SalesValue .value))

this should fix your divide by zero error.

Regards,

Anish Shenoy

"Mark this post as answer if this post helps you it might help others also."

• Marked as answer by Monday, October 18, 2010 11:39 AM
Monday, October 18, 2010 6:08 AM

### All replies

• Hi.

For divide by zero error you can use iff statement in the expression where you are populating the " BranchStockValue / SalesValue"

For example :

here your SalesValue should not be zero since that is your denominator, write an expression some thing like this :

iif(condition,true,false)

iif(Fields! SalesValue.value = 0,"0", (Fields!BranchStockValue.value / Fields!SalesValue .value))

this should fix your divide by zero error.

Regards,

Anish Shenoy

"Mark this post as answer if this post helps you it might help others also."

• Marked as answer by Monday, October 18, 2010 11:39 AM
Monday, October 18, 2010 6:08 AM
• Thank you very much
Monday, October 18, 2010 11:39 AM
• My Pleasure...:)
Monday, October 18, 2010 12:07 PM