Forum Discussion
Counting 2 columns from the same table
- 3 years ago
maybe you can use something like this to count attended and complete
Measure = var _attended = COUNTX(FILTER('Campaign Member',
'Campaign Member'[Attendance] = "Attended"),1)var _complete =COUNTX(FILTER('Campaign Member', 'Campaign Member'[Interview_Status__c] = "Complete"),1)return _attended + _complete
Hi Crazypad
Your dax code produces intersecting part like below:
What about replacing double ampersand with or (||)?
- Crazypad3 years agoRegular Visitor
Hi DataNinja777 - I want it to combine/add both "Attended" and "Complete" but with my original formula, it is only counting Attended.
- DataNinja7773 years ago
Super User
Hi Crazypad
It sounds like your "Attended" field is a subset of "Complete" field, and everyone who "Attended" has "Completed" interview. Is this correct?
Replacing double ampersand ("&&") with double pipe ("||") counts "Complete" without double counting "Attended". Is this what you want?
- Crazypad3 years agoRegular Visitor
Hi DataNinja777,
No, not always does a member attend and complete. So I want it to count Attended(which is a column that populates if a member attended a meeting) and Compete(which is a column that populates if a member completed an interview.
Hope that makes sense and thanks for your help!
- DataNinja7773 years ago
Super User
Hi Crazypad ,
As an illustration where "Attended" has 5 people and "Complete" has 5 people, of which 2 are overlapping with each other, your initial formula with double ampersand will calculate, 2 (only the intersecting part), while my formula with double pipe will calculate 8 (5 + 5 - 2), where 2 is subtracted in order to avoid double counting of the overlapping part. In this illustration, what is your expected outcome? Is it 10 where each "Attended" and "Complete" is counted independently of each other like they are mutually exclusive?