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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Count of Rows if The Date is before Today

Hi,

 

Most probably, it is super easy, but I don't know how to do this in one formula. Please help.

 

I have a column 'ClientEndDate' with empty values (not a client), dates in the future (our current clients), dates in the past (our lost clients).

 

I need to calculate the number of lost clients.

 

I understand that I need to do the following steps:

 

  1. Make sure the ClientEndDate is not Blank
  2. compare ClientEndDate <= TODAY()
  3. Calculate count of rows if the two abovementioned conditions are met.

 

Please help me to create a formula.

 

Thanks 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

Measure = COUNTROWS(FILTER('Table',NOT(ISBLANK([ClientEndDate]))&&[ClientEndDate]<TODAY()))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

 

Share a sample dataset and show the expected result on that sample


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Community Champion
Community Champion

Measure = COUNTROWS(FILTER('Table',NOT(ISBLANK([ClientEndDate]))&&[ClientEndDate]<TODAY()))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

For some reason the formula you provided is counting more than the dates prior to today. I have a  column ("(*) BL Project Finish") in a table ("TASK") that has dates and I want to count the dates in that column that are before today. I tweeked your formulate to fit my data but it is counting more than the dates that are not blank and prior to TODAY. Here is the formula I am using:

BL Project Finish To Date = COUNTROWS(FILTER('TASK',NOT(ISBLANK([(*)BL Project Finish]))&&[(*)BL1 Finish]<TODAY()))
 
Am I missing something?
 



Anonymous
Not applicable

Greg, thank you so much! It worked perfectly well 🙂

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.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors