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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
water-guy-5
Helper III
Helper III

Performing a COUNT function that is based on dates

I have a set of data that updates when a lab sample is taken for a certain facility. The requirement is that a sample needs to be taken by the 15th of each month, however each day day that a sample is not taken it records as "Not Checked". Facility A might look like this

7/1 "Not Checked"
7/2 "Not Checked"
7/3 "Not Checked"
7/4 "Not Checked"
7/5 "Not Checked"
7/6 "Not Checked"

7/7 "Not Checked"

7/8 "Not Checked"
7/9 "Not Checked"

7/10 "Not Checked"

7/11 "Sample Taken"

7/12 "Not Checked"

7/13 "Not Checked"

7/14 "Not Checked"

7/15 "Not Checked"

This satisfies the criteria, and I would like to count it as successful. 

So, in short, I need a measure that checks for "Sample Taken" in the first 15 days of a month (I will have the filter on "this calender month" so no need to worry about each month).

2 ACCEPTED SOLUTIONS
Tahreem24
Super User
Super User

@water-guy-5 ,
Try this measure:

Count = CALCULATE(COUNT(Tbl1[Status]),Tbl1[Status]="Sample Taken", DAY(Tbl1[Date])<=15)
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

v-luwang-msft
Community Support
Community Support

Hi @water-guy-5 ,

Try the below measure:

count = CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),'Table'[Status]="Sample Taken"))

base data:

vluwangmsft_0-1628587461309.png

 

Visual:

when date choose 7/1 to 7/5:

vluwangmsft_1-1628587503456.png

when date choose 7/1 to 7/9:

vluwangmsft_2-1628587544481.png

 

Wish it is helpful for you!

 

Best Regards

Lucien

 

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @water-guy-5 ,

Try the below measure:

count = CALCULATE(COUNTROWS('Table'),FILTER(ALLSELECTED('Table'),'Table'[Status]="Sample Taken"))

base data:

vluwangmsft_0-1628587461309.png

 

Visual:

when date choose 7/1 to 7/5:

vluwangmsft_1-1628587503456.png

when date choose 7/1 to 7/9:

vluwangmsft_2-1628587544481.png

 

Wish it is helpful for you!

 

Best Regards

Lucien

 

Tahreem24
Super User
Super User

@water-guy-5 ,
Try this measure:

Count = CALCULATE(COUNT(Tbl1[Status]),Tbl1[Status]="Sample Taken", DAY(Tbl1[Date])<=15)
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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