Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Count Values in a column

Hi Experts

See DAX formula below, i am trying to count all occurance that are not A,B,C,D

CALCULATE(
COUNTROWS('STG Fact_To_Do'),
'STG Fact_To_Do'[Task_Results] in {"A","B","C","D"})
This returns back the count of A:D if i wanted to count the rest of the values could i use
CALCULATE(
COUNTROWS('STG Fact_To_Do'),
'STG Fact_To_Do'[Task_Results] <>{"A","B","C","D"})
  • Hi Anonymous ,

     

    No you can't use <> with multiple values.

    You will have to give multiple <> conditions or you can write it this way:

    CALCULATE(
    COUNTROWS('STG Fact_To_Do'),
    NOT('STG Fact_To_Do'[Task_Results]) IN {"A","B","C","D"})
     
    Thanks,
    Pragati

2 Replies

  • Hi Anonymous ,

     

    No you can't use <> with multiple values.

    You will have to give multiple <> conditions or you can write it this way:

    CALCULATE(
    COUNTROWS('STG Fact_To_Do'),
    NOT('STG Fact_To_Do'[Task_Results]) IN {"A","B","C","D"})
     
    Thanks,
    Pragati
    • Anonymous's avatar
      Anonymous
      Not applicable

      thanks for the excellent feedback