Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  Anonymous ,

    I created some data:

    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:

     

    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

2 Replies