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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
tomperro
Helper V
Helper V

Count of a measure

I need some help figuring out how to get a count of a measure that is greater than 0.

I created 2 measures to try and solve this problem, but I am unable to get what I need.
My first measure checks to see when an employee had a Non-Compliant (NC) test and if they need a follow-up test. If the date of the last NC test is greater than the last NC test and greater than 30 from today mark it as YES else NO.
 
The second measure (NC_FollowUpRequiredFilter) is just used for filtering.
 
I need to show a total count of NC_Follow_Up_Required=YES
 
NC_Follow_Up_Required =
IF( AND([Date_of_Last_NC] = [Date_of_Last_NC_Follow_Up], DATEDIFF([Date_of_Last_NC],TODAY(),DAY) >30 ), "YES", IF([Date_of_Last_NC_Follow_Up] > [Date_of_Last_NC],"NO",0))

NC_FollowUpRequiredFilter =
if([NC_Follow_Up_Required]="YES",1,0)
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @tomperro ,

To get a count of a measure that is greater than 0, you can use the COUNTROWS function in Power BI. Here’s how you can modify your second measure to get the desired result:

NC_FollowUpRequiredFilter = IF([NC_Follow_Up_Required]=“YES”,1,0)

Then, you can create a new measure that uses the COUNTROWS function to count the number of rows where NC_Follow_Up_Required is greater than 0:

NC_FollowUpRequiredCount = COUNTROWS(FILTER(‘Table’, [NC_FollowUpRequiredFilter] > 0))

This measure will give you the total count of NC_Follow_Up_Required=YES. You can then use this measure in your visualizations to display the count.

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @tomperro ,

To get a count of a measure that is greater than 0, you can use the COUNTROWS function in Power BI. Here’s how you can modify your second measure to get the desired result:

NC_FollowUpRequiredFilter = IF([NC_Follow_Up_Required]=“YES”,1,0)

Then, you can create a new measure that uses the COUNTROWS function to count the number of rows where NC_Follow_Up_Required is greater than 0:

NC_FollowUpRequiredCount = COUNTROWS(FILTER(‘Table’, [NC_FollowUpRequiredFilter] > 0))

This measure will give you the total count of NC_Follow_Up_Required=YES. You can then use this measure in your visualizations to display the count.

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

Fowmy
Super User
Super User

@tomperro 

Please share a PBI file with dummy data using Google Drive link here. 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.