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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Formula for Active Contacts Measure - Newbie help!

Hi all, I'm fairly new to PowerBI, but after searching through the internet i haven't been able to find the solution to my problem.

 

I need help with my DAX formula for a measure of active contacts in our system.  The formula I was given by a colleague isn't working, and I can't seem to find out why.

 

Active Contacts (Accum) =

CALCULATE(

COUNT('CE vwContact'[CreatedOn]),

IF('CE vwContact'[CreatedOn] <= MAX('BI vwCalendar'[Date]),

AND('CE vwContact'[Rics_LapsedDate]=BLANK

)))

 

After searching around and looking at other ways to doing it, I've arrived at the following, but PBI is saying there's an error in line 3, but I don't know why:

 

Active Contacts (Accum) =
CALCULATE(DISTINCTCOUNT('CE vwContact'[Rics_contactno])
RETURNIF('CE vwContact'[CreatedOn] >= TODAY() AND ('CE vwContact'[Rics_LapsedDate] <= TODAY())))
 
Can anyone help me with it?
 
Cheers!!
DaveH
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1647585070507.png

Here are the steps you can follow:

1. Create measure.

Active Contacts (Accum) =
CALCULATE(DISTINCTCOUNT('CE vwContact'[Rics_contactno]),
FILTER(ALL('CE vwContact'),'CE vwContact'[CreatedOn]>=TODAY()&&'CE vwContact'[Rics_LapsedDate]<=TODAY()))

2. Result:

vyangliumsft_1-1647585070507.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1647585070507.png

Here are the steps you can follow:

1. Create measure.

Active Contacts (Accum) =
CALCULATE(DISTINCTCOUNT('CE vwContact'[Rics_contactno]),
FILTER(ALL('CE vwContact'),'CE vwContact'[CreatedOn]>=TODAY()&&'CE vwContact'[Rics_LapsedDate]<=TODAY()))

2. Result:

vyangliumsft_1-1647585070507.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

amitchandak
Super User
Super User

@Anonymous , check this this very similar to active employee in this blog

 

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

 

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.