Forum Discussion
mrsbusch
1 year agoRegular Visitor
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...
- 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 resultBest Regards,
DangarIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Dangar332
1 year agoResident Rockstar
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.