Forum Discussion
osinquinvdm
Advocate II
9 years agoHow come it is aggregating?
I have requests that can be either service requests or information requests. I have the following 3 measures to count them: Nb Requests = CALCULATE(COUNT('311_Details'[DDS]))
Nb Service Reques...
- 9 years ago
Nb Info Requests = CALCULATE ( [Nb Requests]; FILTER ( '311_Details'; '311_Details'[Nature] = "Information" ) ) Nb Service Requests = CALCULATE ( [Nb Requests]; FILTER ( '311_Details'; '311_Details'[Nature] <> "Information" ) )The way you had originally written these they had an implied ALL function
FILTER ( ALL ( '311_Details'[Nature] )... => therefore ignoring any existing filter context!
http://www.sqlbi.com/articles/filter-arguments-in-calculate/
Sean
Community Champion
9 years agoNb Info Requests =
CALCULATE (
[Nb Requests];
FILTER ( '311_Details'; '311_Details'[Nature] = "Information" )
)
Nb Service Requests =
CALCULATE (
[Nb Requests];
FILTER ( '311_Details'; '311_Details'[Nature] <> "Information" )
)
The way you had originally written these they had an implied ALL function
FILTER ( ALL ( '311_Details'[Nature] )... => therefore ignoring any existing filter context!
http://www.sqlbi.com/articles/filter-arguments-in-calculate/
osinquinvdm
Advocate II
9 years agoThank you so much.
I had no idea that not using an explicit FILTER() function would actually result in using an implicit ALL() function.
The small tweak you recommended made all the difference.
Thanks again !