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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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