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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
melimob1
Helper I
Helper I

MEASURE - CONTAINSTRING - MULTIPLE TEXT

Hi, I have the below measure but it's not returning the correct results.

(dummy text as example)

I want to search column and count every time 'apples' or 'oranges' appear.

 

Total Client Count FRUIT  = 
CALCULATE(
    COUNT(_3_DataSet[Client]),
    CONTAINSSTRING(_3_DataSet[field], "APPLES" ),
        CONTAINSSTRING (_3_DataSet[field], "ORANGE" )
    )

 

 data set may look like this

ClientField 
aapple 
borange, apple 
capple, orange 
dorange, other 
eburger 

 

my result should be: 4 as their are 4 rows containing at least the fruit I was looking for.

 

Any help appreciated,

thanks

 

1 ACCEPTED SOLUTION

OR = ||

AND  = &&



Proud to be a Super User!

daxformatter.com makes life EASIER!

View solution in original post

5 REPLIES 5
melimob1
Helper I
Helper I

thank you so much!

melimob1
Helper I
Helper I

actually, think I have just got it to work but would appreciate advice.. I added

|| after the first containstring... does this stand for 'or'?

 

many thanks

Hi @melimob1 ,

 

That's right, || means OR. 

 

Best regards,

thank you so much!! am new to PBI and haven't come across this yet!! very good to know!

may I ask, what is the code for 'AND'?  is it + or & or and or something completley different?

OR = ||

AND  = &&



Proud to be a Super User!

daxformatter.com makes life EASIER!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.