Home > Back-end >  Conditioned sum function in report
Conditioned sum function in report

Time:11-07

Regarding MS Access, I need to add a Text box on a report that gets sum of a field conditional to another field value. I.e. I have a field named [clinic] another one named [clinic_income]. How can I calculate SUM of [clinic_income] only if [clinic] value = Dental clinic?

I tried this formula but it didn't work

Sum(
    Filter(
           'ALL' 
            Clinic = clinicInput. Dental clinic), 
Clinic_income) 

CodePudding user response:

This is what IIf() is for:

=Sum(IIf([Clinic] = "Dental", [clinic_income], Null))

  • Related