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
chris_jones
New Member

Counting three text value in a column

Hi,

 

I have one expression that works for only one value but having issues trying to expand it for three.

 

Example - That works for just counting how many times APPLE is listed in the Fruit Column

 

Total Count = CALCULATE ( COUNTROWS ( 'MyData' ), 'MyData[Fruit] = "APPLE" )

 

I want to count how many times, APPLE, PEAR or PLUM are in the same column.

 

Any Help?

1 ACCEPTED SOLUTION
dedelman_clng
Community Champion
Community Champion

Hi @chris_jones  - use the OR command or the || method

 

Total Count = 
CALCULATE ( COUNTROWS ( 'MyData' ), 
  OR('MyData[Fruit] = "APPLE", OR('MyData[Fruit] = "PEAR", 'MyData[Fruit] = "PLUM")))

Total Count = 
CALCULATE ( COUNTROWS ( FILTER( 'MyData' ), 
  'MyData[Fruit] = "APPLE" || 'MyData[Fruit] = "PEAR" || 'MyData[Fruit] = "PLUM"))

 

Either of those should work.

 

Hope this helps

David

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@chris_jones ,

Total Count = CALCULATE ( COUNTROWS ( 'MyData' ), 'MyData[Fruit] in { "APPLE","PEAR","PLUM" } )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
dedelman_clng
Community Champion
Community Champion

Hi @chris_jones  - use the OR command or the || method

 

Total Count = 
CALCULATE ( COUNTROWS ( 'MyData' ), 
  OR('MyData[Fruit] = "APPLE", OR('MyData[Fruit] = "PEAR", 'MyData[Fruit] = "PLUM")))

Total Count = 
CALCULATE ( COUNTROWS ( FILTER( 'MyData' ), 
  'MyData[Fruit] = "APPLE" || 'MyData[Fruit] = "PEAR" || 'MyData[Fruit] = "PLUM"))

 

Either of those should work.

 

Hope this helps

David

Thank you @dedelman_clng 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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