Forum Discussion

SJ25's avatar
SJ25
Icon for Resolver I rankResolver I
6 years ago
Solved

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?
  • 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] <> "" )))))

5 Replies

  • Hi,

    This simplified measure should work

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

  • 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] <> "" )))))

  • 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!

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    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