cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## 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.

1 ACCEPTED SOLUTION
Super User

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")
return
Total-NamesWithX

4 REPLIES 4
Community Support

Hi @sabry_303 ,

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.

Super User

@sabry_303 Try this measure:

Measure = CALCULATE(COUNT(CountTable[Name]),FILTER(CountTable,CountTable[Flag]="X"))

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Super User

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")
return
Total-NamesWithX

Frequent Visitor

name and flag are seperate columns