Forum Discussion
KBIReports
2 years agoFrequent Visitor
Ignore slicer in weighted average calculation
Hello, I need to create a weighted average measure in a matrix that ignores a slicer on the page. The matrix should contain Wtd Avg THC by Strain for a specific date and a WTD Avg THC by Strain a...
Anonymous
2 years agoNot applicable
Hi KBIReports ,
Try to modify your formula like below:
1 =
VAR __CATEGORY_VALUES =
VALUES ( 'AllLab'[Harvest] )
RETURN
DIVIDE (
SUMX (
__CATEGORY_VALUES,
CALCULATE (
AVERAGE ( 'AllLab'[THC] ) * SUM ( 'AllLab'[Grams] ),
REMOVEFILTERS ( 'AllLab'[WeekOf] ),
'AllLab'[Type] = "Flower"
)
),
SUMX (
__CATEGORY_VALUES,
CALCULATE (
SUM ( 'AllLab'[Grams] ),
REMOVEFILTERS ( 'AllLab'[WeekOf] ),
'AllLab'[Type] = "Flower"
)
)
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
KBIReports
2 years agoFrequent Visitor
Hi @v-kongfanf-msft. I used your suggested formula. The first strain displayed the weighted average ignoring the slicer but the second strain is not ignoring the week selected. Below are images of the data: