Forum Discussion
analyticspbi87
1 year agoHelper I
Weighted Average while filtering out another column
I was trying to make a chart from the data as follows with the filter on category = A Category Name Year Value Health Class Class 2 A Celery 2025 14 ...
- 1 year ago
Hi,
PBI file attached.
Hope this helps.
vicky_
1 year agoSuper User
Here's my measure:
Cam calc = DIVIDE(
SUM('Table'[ Health ]) * SUM('Table'[Value]),
CALCULATE(SUM('Table'[ Health ]), REMOVEFILTERS('Table'[Class]))
)
and the result (ignore the Sum of Value column):
btw - I can't get the same results as your example (I just filtered by Category = A; why would Asparagus not be included in the Cam calc measure in the veg subtotal? you might need to change the calculate parameter depending on your specific requirements)