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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Measure for countrows is not returning accurate count

All, I am using countrows function to calculate count of rows where status field value is 'Late', see screenshot below. 

learningPbidev_0-1656457274526.png

Here is the measure formula I am using: 

COUNTROWS(FILTER('ReceiptData withPOLines','ReceiptData withPOLines'[Status]="Late")), just fyi status is a text field. 
 
However, the measure count seems off, when I put a card visual and add measure on it, it shows below. IDeally the count should be 2 instead of 4, so it looks like something is off. Is my formula not accurate? Please assist, thanks in advance. 
learningPbidev_1-1656457375628.png

 

5 REPLIES 5
Anonymous
Not applicable

To dig deeper into this, I added a column called latecount with the formula: @GilbertQ 

if('ReceiptData withPOLines'[Status]="Late",1,0) and  got to know what is going off here. See screenshot below. 
learningPbidev_3-1656467009913.png

 


 

 Ideally if the status value is late then it should log 1 in latecount field but its doing something else, that is where the discrepancy is coming up. When I do 'dont summarize' for latecount field then it gives me 1 for all late values. No other filters are in place.

 

learningPbidev_2-1656466948018.png

Hi @Anonymous 

 

Without having your actual data there is certainly something going on with the Status column causing this to not work as expected.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

GilbertQ
Super User
Super User

Hi @Anonymous 

 

Can you try the following measure and see if this works?

If you can also make sure that there is no white space before or after the Status?

 

Total Receipts = CALCULATE(COUNTROWS('ReceiptData withPOLines'),'ReceiptData withPOLines'[Status]="Late")




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Anonymous
Not applicable

@GilbertQ Thanks so much for your response. I tried the same but the count is still off, thoughts?

Hi @Anonymous 

 

Can you confirm there are no other filters on your page?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

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.

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.

Top Solution Authors