Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Error for sum and filter

Hi, 

 

I am getting below error while calculating the sum with filter

 

 

 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    When using table functions like FILTER, ALL, etc, you must reference the table name/query separated by a comma (in bold) and then you reference the column/field you want filtered, e.g., 

     

    OpenTotal = CALCULATE(
                              SUM( Query1[leadId] ),
                              FILTER( Query1, Query1[activity] = "opened") )

     

    This may not be the perfect DAX syntax, but you get the idea. 

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    When using table functions like FILTER, ALL, etc, you must reference the table name/query separated by a comma (in bold) and then you reference the column/field you want filtered, e.g., 

     

    OpenTotal = CALCULATE(
                              SUM( Query1[leadId] ),
                              FILTER( Query1, Query1[activity] = "opened") )

     

    This may not be the perfect DAX syntax, but you get the idea.