How to do Avg and IIF Statement together

  • Hi,

    I have the following formula and I want to be able to avg the payments if the two values = Dental and Claims. However I am unsure on how to do this.

    Below is my code:

    =(IIF(Fields!PrimaryGroup.Value = "Caims" AND Fields!Section.Value = "Dental",1,0, (Avg(Fields!Payments.Value))

    thank you

  • I believe that you're looking for something like this:

    =Avg(IIF(Fields!PrimaryGroup.Value = "Caims" AND Fields!Section.Value = "Dental",Fields!Payments.Value,Nothing))

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Thank you

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply