Forum Discussion

ledoyle1121's avatar
ledoyle1121
Frequent Visitor
8 years ago
Solved

DAX formulas for Where statements

Hi,

 

I have a column in my data which is called "NPS Category", which classifies each Case Number listed. Each row in the data either have the values of "Promoter", "Detractor", or "Neutral" within this NPS Category column. 

 

I'm trying to create a measure similar to the below for each of the possible Category values (Promoter, Detractor, or Neutral): 

 

NPS Neutral Count =(Count([Case Number]Where([NPS Categories]="Neutral")))

 

This would give me a final count of the number of rows that have the value of "Neutral". The "Case Number" would be a unique value for each row. 

 

I'm having trouble figuring how to do this with DAX, and was hoping someone could help?

 

Thanks!

 

  • Measure =
    CALCULATE (
        DISTINCTCOUNT ( Table[CaseNumber] ),
        Table[NPS Category] = "Neutral"
    )

2 Replies

  • Measure =
    CALCULATE (
        DISTINCTCOUNT ( Table[CaseNumber] ),
        Table[NPS Category] = "Neutral"
    )
    • ledoyle1121's avatar
      ledoyle1121
      Frequent Visitor

      Not sure what I was doing wrong before - but that worked perfect, thanks!!