Forum Discussion
ALLEXCEPT help needed
- 5 years ago
Hi zivhimmel ,
Would you please try to use the following measure:
avg_satisfaction_Same_city= CALCULATE(AVERAGE('Fact Sale'[satisfaction]),ALLEXCEPT('Dim Customer','Dim Csutomer'[City]))If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
zivhimmel , All except, mean all filter other than what you mentioned will be ignored.
refer: https://www.sqlbi.com/articles/using-allexcept-versus-all-and-values/
Thanks amitchandak . This is exactly what I want. I want to city of the customer to be respected (not ignored), but the customer filter to be ignored. I want to see all customers records from the same city as my customer. Happy to do it any other way, doesn't have to be ALLEXCEPT. Thanks.
- amitchandak5 years agoSuper User
Try like
calculate(
AVERAGEX(ALL('Fact Sale'),'Fact Sale'[satisfaction]),filter(allselected('Dim Customer'),'Dim Csutomer'[City] = max('Dim Csutomer'[City]))
)- zivhimmel5 years agoResolver I
Thanks again. It doesn't work however.
It returns an avg of all values, ignoring all filters.