Forum Discussion

mrsbusch's avatar
mrsbusch
Regular Visitor
1 year ago
Solved

Aggregated Sum over Two Columns

I have been struggling to find the total sum of one column grouped by conditions of other two columns. For privacy purposes, let's say it's a veterinary dataset (it's not). Each row is for a specifi...
  • Dangar332's avatar
    1 year ago

    Try below measure 

    column =
            VAR Curr_vet = Vax[Vet ID]
    	VAR curr_animal_id = Vax[Animal ID]
    	VAR result = SUMX(
    		FILTER(
    			Vax,
    			Vax[Vet ID] = Curr_vet && Vax[Animal ID] = curr_animal_id
    		),
    		Vax[Vaccines]
    	)
    	RETURN
    		result

     

    Best Regards,
    Dangar

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.