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
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
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.

Top Solution Authors
Top Kudoed Authors