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
EdK99
Frequent Visitor

COUNT, COUNTROWS, and COUNTA are returning wrong values

Hello,

 

I'm trying to use the count functions and they are returning different values than what they're supposed to.

 

Measure LIVE Orders = CALCULATE(COUNTROWS(Table2022), 'Table2022'[Order Status] = "LIVE", 'Table2022'[Price] <> BLANK())
 
When I look into my excel sheet after I filter the status to live and the price to All except for blanks I get 28 rows, when I look in the data tab in power bi and I filter the same way I also get 28 rows, but when I use any count function it returns only 27 rows.
Note: one of the Price column rows has a value of 0, and two of the rows in the Price column have the same value. Also, If I add the condition I need in the filter pane of the visualizer and choose advanced filtering: is not blank and remove this part Table2022'[Price] <> BLANK() of my measure., I get 28 rows, I also get the correct result (28) if I use a slicer and remove this part Table2022'[Price] <> BLANK() of my measure.
I'm not sure if that's causing the error or not but I'd really like to get this fixed.
 
 
Any thought?
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Blank equates to 0 so don't use var = BLANK(), or var <> BLANK(). Instead use the ISBLANK() function, or NOT ISBLANK()

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

Blank equates to 0 so don't use var = BLANK(), or var <> BLANK(). Instead use the ISBLANK() function, or NOT ISBLANK()

EdK99
Frequent Visitor

That did it!! thanks a lot

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.