cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rjain12 Regular Visitor
Regular Visitor

Count rows that match a certain string from a column

Hi,

 

I want to count rows that contain a certain value from a long string in a column

 

Table

 

id   meta

1    apples_abc_def

2    mangoes_abc_def

 

Count rows where meta contains apples

 

How do I write this is dax? I tried search function but it did not work. 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Count rows that match a certain string from a column

=calculate (countrows(tablename), search("apples", tablename[meta],, 0)>0)
1 REPLY 1
Super User
Super User

Re: Count rows that match a certain string from a column

=calculate (countrows(tablename), search("apples", tablename[meta],, 0)>0)