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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

DAX help - Less than or Blank

Hi geniuss!!!

 

I'm trying to create a measure that I'll be using against a calendar table to plot number of active contacts at any given time, but I'm tearing my hair our with some of these measures...

 

In simple terms, I'm trying to create a measure, that will count the number of our members, at any given time, who have a qualification date of greater than or qual to *Date*

AND a leave date that is blank OR less than or equal to *Date*.

 

Its the 2nd part that I'm having trouble with.  So far I've got to:

 

COUNT('CE vwContact (2)'[Rics_contactno], 'CE vwContact (2)'[Rics_LapsedDate]<= 'BI vwCalendar (2)','-Calendar'[Date],
OR('CE vwContact (2)'[Rics_LapsedDate]= BLANK())
 
But its saying its incorrect.  I think it could be because I'm trying to do 2 formulas at the same time, but I've tried to seperate them with no luck either....
 
My whole formula is:
Members TEST =
CALCULATE(
DISTINCTCOUNT('CE vwContact (2)'[Rics_contactno]),
'CE vwContact (2)'[Rics_ElectionDate]>= 'BI vwCalendar (2)','-Calendar'[Date],
COUNT('CE vwContact (2)'[Rics_contactno], 'CE vwContact (2)'[Rics_LapsedDate]<= 'BI vwCalendar (2)','-Calendar'[Date],
'CE vwContact (2)', 'CE vwContact (2)'[Rics_LapsedDate]= BLANK()
))
 
But its just the counting of the blank or less than date.
 
Can anyone help?
 
Cheers
1 ACCEPTED SOLUTION
tamerj1
Community Champion
Community Champion

Hi @Anonymous 
You may try

Members TEST =
VAR CurrentDate =
    MAX ( '-Calendar'[Date] )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( 'CE vwContact (2)'[Rics_contactno] ),
        'CE vwContact (2)'[Rics_ElectionDate] >= CurrentDate,
        OR (
            'CE vwContact (2)'[Rics_LapsedDate] <= CurrentDate,
            'CE vwContact (2)'[Rics_LapsedDate] = BLANK ()
        )
    )

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Awesome! That works, I'm going to have to play around with getting the visualisation of active members by date but the measure works,  I just had to change the Or to an AND, but its accepted in which is great.  

Thank you!!

tamerj1
Community Champion
Community Champion

Hi @Anonymous 
You may try

Members TEST =
VAR CurrentDate =
    MAX ( '-Calendar'[Date] )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( 'CE vwContact (2)'[Rics_contactno] ),
        'CE vwContact (2)'[Rics_ElectionDate] >= CurrentDate,
        OR (
            'CE vwContact (2)'[Rics_LapsedDate] <= CurrentDate,
            'CE vwContact (2)'[Rics_LapsedDate] = BLANK ()
        )
    )

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.