Forum Discussion
osinquinvdm
9 years agoAdvocate II
How 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
9 years agoCommunity Champion
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/
osinquinvdm
9 years agoAdvocate II
Thank 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 !