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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.