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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Measure active contacts of a certain grade

Hi all.  Me again.... I've been struggling with a measure formula for a few days building on from the last one.

 

I've looked at a few posts with similar problems but can't seem to sort the formula....

 

I'm trying to count using a measure, active contacts of a specific grade.

 

My active contacts measure (that works) is:

Active Contacts = CALCULATE (
DISTINCTCOUNT('CE vwContact'[Rics_contactno]),'CE vwContact'[Rics_LapsedDate]<=TODAY())
 
I then want to add a filter to count only active contacts who have a grade of 
200000001 and 200000002
 
The DAX I created is as follows, but its not working... There appears to be errors on lines 3 and 4, but I'm not sure where I'm going wrong.  Can someone help?  Thanks
 
Active Members = CALCULATE(
DISTINCTCOUNT('CE vwContact'[Rics_contactno]),'CE vwContact'[Rics_LapsedDate]<=TODAY(),
FILTER('CE vwContact'[Rics_MemberGrade],
('CE vwContact'[Rics_MemberGrade]=200000001, AND('CE vwContact'[Rics_MemberGrade]=200000002),0)))
1 ACCEPTED SOLUTION
m3tr01d
Continued Contributor
Continued Contributor

@Anonymous you mean you want the grade to be 200000001 OR 200000002? I assume it cannot be both at the same time ...

Also, the first argument of FILTER needs to be a table and you are passing a column.
Second, you are not using the AND operator correctly.

Anyway, you don't need to user the FILTER statement in that case. Maybe this will do :

My_Measure = 
CALCULATE(
	DISTINCTCOUNT('CE vwContact'[Rics_contactno]),
	'CE vwContact'[Rics_LapsedDate]<=TODAY(),
	'CE vwContact'[Rics_MemberGrade] IN {'200000001','200000002'}
)

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you so much!  That sorted it.  The only thing I had to chance was putting " instead of ' around the 200000001 numbers.  Thank you!!

m3tr01d
Continued Contributor
Continued Contributor

@Anonymous you mean you want the grade to be 200000001 OR 200000002? I assume it cannot be both at the same time ...

Also, the first argument of FILTER needs to be a table and you are passing a column.
Second, you are not using the AND operator correctly.

Anyway, you don't need to user the FILTER statement in that case. Maybe this will do :

My_Measure = 
CALCULATE(
	DISTINCTCOUNT('CE vwContact'[Rics_contactno]),
	'CE vwContact'[Rics_LapsedDate]<=TODAY(),
	'CE vwContact'[Rics_MemberGrade] IN {'200000001','200000002'}
)

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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