Forum Discussion

osinquinvdm's avatar
osinquinvdm
Advocate II
9 years ago
Solved

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...
  • Sean's avatar
    Sean
    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" )
    )
    
    

    osinquinvdm

    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/