cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jvanarsdale
Frequent Visitor

How do I count rows and exclude certain text?

I see lots of answers on how to count rows containing certain text, but I need to count rows of text that do not contain the word "Open". How do I do this?

1 ACCEPTED SOLUTION

Yes! That worked! Thank you SO much! Been struggling all morning on that. I am a relatively new user.

View solution in original post

6 REPLIES 6
jvanarsdale
Frequent Visitor

Unfortunately, this didn't work. Is there another piece to the code?

jvanarsdale_0-1685625566170.png

 

I just sent you the FILTER (which you need to use inside CALCULATE).

 

Create a new measure like this :

 

YourMeasure = CALCULATE( COUNT('YourTable'[YourColumn]),FILTER('YourTable', NOT(CONTAINSSTRING('YourTable'[YourColumn], "Open")))

 

Have a nice day.

Yes! That worked! Thank you SO much! Been struggling all morning on that. I am a relatively new user.

Glad it is working well 🙂

pratyashasamal
Solution Sage
Solution Sage

Hi @jvanarsdale ,
Please try this .
Price Count = IF( 'Product'[List Price] != "Open", COUNTROW( 'Product'[Text] ))
Thanks ,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

Timuran
Resolver I
Resolver I

Hello @jvanarsdale ,

 

You can use NOT() in your filter.

 

Would looks like :

 

 

 

FILTER('YourTable', NOT(CONTAINSSTRING('YourTable'[YourColumn], "Open"))

 

 

The measure would be :

 

 

YourMeasure = CALCULATE( COUNT('YourTable'[YourColumn]),FILTER('YourTable', NOT(CONTAINSSTRING('YourTable'[YourColumn], "Open")))

 

Have a nice day

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors