Forum Discussion
Apply Filter before Calculating Average
- 6 months ago
Your visual-level filter measure is evaluated at the current visual grain (Product-State), not at the underlying Product-State-Date row level, so it won’t exclude date rows first. Use the threshold condition inside each aggregation measure instead:
Threshold % = 0.11Sales (Filtered) = VAR T = [Threshold %] RETURN CALCULATE( SUM('Fact'[Sales]), KEEPFILTERS( FILTER('Fact', 'Fact'[Damage%] < T) ) )Costs (Filtered) = VAR T = [Threshold %] RETURN CALCULATE( SUM('Fact'[Costs]), KEEPFILTERS( FILTER('Fact', 'Fact'[Damage%] < T) ) )Damage % (Filtered) = VAR T = [Threshold %] RETURN CALCULATE( AVERAGE('Fact'[Damage%]), KEEPFILTERS( FILTER('Fact', 'Fact'[Damage%] < T) ) ) - 6 months ago
Hi,
PBI file attached.
Hope this helps.
Thankyou, cengizhanarslan, jgeddes and Ashish_Mathur for your responses.
Hi powerlight1,
We appreciate your inquiry through the Microsoft Fabric Community Forum.
We would like to inquire whether have you got the chance to check the solutions provided by cengizhanarslan, jgeddes and Ashish_Mathur to resolve the issue. We hope the information provided helps to clear the query. Should you have any further queries, kindly feel free to contact the Microsoft Fabric community.
Thank you.