Forum Discussion

EdK99's avatar
EdK99
Frequent Visitor
3 years ago
Solved

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?
  • Blank equates to 0 so don't use var = BLANK(), or var <> BLANK(). Instead use the ISBLANK() function, or NOT ISBLANK()

2 Replies

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