question

MuraliKrishna avatar image
MuraliKrishna asked

How To Remove #Error in SSRS

i have an ssrs report in which i have to calculate percentage iam getting percentage my problem is iam getting #Error if the value is 0/1 i want to replace #Error with 0 i wrote below expression for percentage calculation ((Sum(Sum(Switch(Fields!Data_Center.Value="Revenue",Fields!Amount1.Value))-sum(Fields!Amount.Value))/Sum(Switch(Fields!Data_Center.Value="Revenue",Fields!Amount1.Value)))*100)/100 how to achieve that one.... i wrote below expression to solve that one... =IIF((Sum(Sum(Switch(Fields!Data_Center.Value="Revenue",Fields!Amount1.Value))-sum(Fields!Amount.Value))/Sum(Switch(Fields!Data_Center.Value="Revenue",Fields!Amount1.Value)))= 0,0,((Sum(Sum(Switch(Fields!Data_Center.Value="Revenue",Fields!Amount1.Value))-sum(Fields!Amount.Value))/Sum(Switch(Fields!Data_Center.Value="Revenue",Fields!Amount1.Value)))*100)/100) but iam unable to remove #Error can any one suggest me how to do this
ssrs
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
David Wimbush avatar image
David Wimbush answered
I suspect it's because `Sum(Switch(Fields!Data_Center.Value="Revenue",Fields!Amount1.Value))` = 0 and that's giving you a divide by zero error. So instead of testing the whole calculation for zero just test that part.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.