Forum Discussion
Simple Count with critreria
Hi Guru,
I would like to create a measure to count the below names that were never flagged as 'X', result should be 2.
| Name | Flag |
| John | |
| Sam | |
| Jess | |
| Adam | |
| Adam | X |
| Adam | |
| Sam | X |
Hi,
you could create a measure that totals a distinct count of all names and calculates the number with an X then minus the names with x from the total:
Measure =var Total = CALCULATE(DISTINCTCOUNT('Table'[Name]))Var NamesWithX = CALCULATE(DISTINCTCOUNT('Table'[Name]),'Table'[Flag]="X")returnTotal-NamesWithXIf I answered your question, please mark my post as solution, Appreciate your Kudos 👍
4 Replies
- DOLEARY85Resident Rockstar
Hi,
you could create a measure that totals a distinct count of all names and calculates the number with an X then minus the names with x from the total:
Measure =var Total = CALCULATE(DISTINCTCOUNT('Table'[Name]))Var NamesWithX = CALCULATE(DISTINCTCOUNT('Table'[Name]),'Table'[Flag]="X")returnTotal-NamesWithXIf I answered your question, please mark my post as solution, Appreciate your Kudos 👍 - Tahreem24Super User
Anonymous Try this measure:
Measure = CALCULATE(COUNT(CountTable[Name]),FILTER(CountTable,CountTable[Flag]="X")) - AnonymousNot applicable
name and flag are seperate columns
- AnonymousNot applicable
Hi Anonymous ,
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please feel free to let me know.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.