Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
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
| Client | Field | |
| a | apple | |
| b | orange, apple | |
| c | apple, orange | |
| d | orange, other | |
| e | burger |
my result should be: 4 as their are 4 rows containing at least the fruit I was looking for.
Any help appreciated,
thanks
Solved! Go to Solution.
OR = ||
AND = &&
thank you so much!
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
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 = &&
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 18 | |
| 11 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 31 | |
| 25 | |
| 21 | |
| 14 | |
| 12 |