Forum Discussion

jonclay's avatar
jonclay
Helper IV
4 years ago
Solved

Problems with COUNTA, COUNTX etc

Hi there everyone,

I seem to have a real blindspot for Power BI counting and I wonder if you could please help me?

My dataset contains a number of people who have made donations. Some of them have ages and some don't. I'm trying to count the number of people with an age. So, in the example below, we have 14 lines of data, 4 contacts, but only two of them have an age, so the answer woud be 2:

 


My table is called 'contact' so I've tried the following Measure:

With Age = COUNTAX(FILTER('contact',DISTINCTCOUNT(contact[id])),contact[Age?])

Age? (the field referred to in the above Measure) is a calculated column that equals "Yes" if there is an age and null if there isn't an age.

When I run this Measure I get a total of 14, so the same total that I'd get if I just did =COUNTA(contact[Age?]).

Help please!!
Many thanks,
Jon



3 Replies