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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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