Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ledoyle1121
Frequent Visitor

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!

 

1 ACCEPTED SOLUTION
mattbrice
Solution Sage
Solution Sage

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

View solution in original post

2 REPLIES 2
mattbrice
Solution Sage
Solution Sage

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

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.