Forum Discussion
Anonymous
4 years agoNot applicable
PowerBI CountRows IF Column Contains
I am trying count the number of rows in a table if a column CONTAINS certain text.... I have created a list of the items (13 items) which i need to check against the column to identify it it contains the data.
For example:
Search Column1 to see if it CONTAINS "egg", "apple", rice"
and count the rows that return.
Anonymous
Try it like this.
Item Count = CALCULATE ( COUNTROWS ( YourTable ), 'YourTable'[Column1] IN { "egg", "apple", "rice" } )
2 Replies
- jdbuchanan71Super User
Anonymous
Try it like this.
Item Count = CALCULATE ( COUNTROWS ( YourTable ), 'YourTable'[Column1] IN { "egg", "apple", "rice" } ) - mh2587Super User
=calculate (countrows(tablename), tablename[column] IN { "egg","apple","rice"})