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
SJ25
Resolver I
Resolver I

Using NOT ISBLANK as a filter

This should be quite simple, as I've done this before and it has worked very well. I'm trying to count rows that aren't blank and then there's the syntax I'm using:

CALCULATE(COUNTROWS('TableName'),FILTER('TableName', NOT(ISBLANK('Tablename'[Sales Order]))))))
But this gives me a count of all the rows, why doesn't this work?

It gives me the correct value when I use <> BLANK but what's wrong with the above method?
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@SJ25 ,

Check if you column has some space trim those

and then try CALCULATE(COUNTROWS('TableName'),FILTER('TableName', NOT(ISBLANK('Tablename'[Sales Order]) && 'Tablename'[Sales Order] <> "" )))))

View solution in original post

5 REPLIES 5
v-shex-msft
Community Support
Community Support

HI @SJ25,

Please check your table records to confirm if your field type changes or new values existed in your records. (empty, null, blank, "" or specific characters)
In addition, I think it will help if you share some dummy data to test.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@SJ25 ,

Check if you column has some space trim those

and then try CALCULATE(COUNTROWS('TableName'),FILTER('TableName', NOT(ISBLANK('Tablename'[Sales Order]) && 'Tablename'[Sales Order] <> "" )))))

sanimesa
Post Prodigy
Post Prodigy

I tried it and it worked as expected. Can you please check the syntax? Looks like something off. 

parry2k
Super User
Super User

@SJ25 depends on what is the data type of the column on which you are checking BLANK(), read more on this here

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Ashish_Mathur
Super User
Super User

Hi,

This simplified measure should work

=COUNTROWS(FILTER('TableName',VALUES('Tablename'[Sales Order])<>BLANK()))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.