Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
stvitus
New Member

CountROW contains multiple text strings - single column

Greetings, 

My data set concatenates multiple field values into a single cell where they appear in the same record. However, there are two variants of each value.  

Trying to create a count measure of rows that contain one value, another value or both. For instance, a five count of rows that contain Blue Car or Blue Truck, and omit Blue Van. 

Record No.Product
875534Blue Truck
875535Blue Car, Blue Truck
875536Blue Van
875537Red Car, Blue Truck
875538Red Car, Red Van
875539Blue Car, Red Truck
875540Blue Car


I've been looking for hours and found a filter query that would return the cells containing one value (rows 1 and 7), but none of the combined ones. Ive been working with CONTAINSSTRING, but can't fugure out how to add add second variable.  

Thank you!

 

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

ThxAlot_0-1683227580940.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

2 REPLIES 2
ThxAlot
Super User
Super User

ThxAlot_0-1683227580940.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



tamerj1
Super User
Super User

Hi @stvitus 

First you need to manually create a disconnected table that contains all the unique values ("Blue car", "Ref Truck", ect.) to be used as a slicer. Then the CountMeasure would be 

 

CountMeasure =
COUNTROWS (
FILTER (
'Table',
NOT ISEMPTY (
FILTER ( SlicerTable, CONTAINSSTRING ( 'Table'[Product], SlicerTable[Value] ) )
)
)
)

 

you can also place it in the filter and filter is 1 or is not 0

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.