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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Dicken
Continued Contributor
Continued Contributor

DAX contains

 

 

Hi, I will try to keep this as simple as i can I have a four column table a,b,c,d, and at least one row of each has the word cat or dog, 

If I write a measure 

CONTAINS( Table2, Table2[A], "dog")

for any columns I will get a true, but if i write 

CONTAINS( Table2, Table2[A], "dog",Table2[B], "dog", Table2[C], "cat",Table2[D] ,"cat"

I get a false, indvidually they all get true, the syntax in docs ; 

CONTAINS(<table>, <columnName>, <value>[, <columnName>, <value>]…)

so why do I get a false?   I'm new to this site, would it be better to use the insert code for the above ? 

 

Richard

2 ACCEPTED SOLUTIONS
Gabry
Super User
Super User

hello,

i think like that you check row by row, so you need to have in the same row Table2[A], "dog",Table2[B], "dog", Table2[C], "cat",Table2[D] ,"cat".

 

Do you have a row where all those conditions are met?

View solution in original post

Dicken
Continued Contributor
Continued Contributor

I have realised that it refers to a row all being true not just any row of each column being true. 
Richard 

View solution in original post

3 REPLIES 3
Dicken
Continued Contributor
Continued Contributor

I have realised that it refers to a row all being true not just any row of each column being true. 
Richard 

Gabry
Super User
Super User

hello,

i think like that you check row by row, so you need to have in the same row Table2[A], "dog",Table2[B], "dog", Table2[C], "cat",Table2[D] ,"cat".

 

Do you have a row where all those conditions are met?

Dicken
Continued Contributor
Continued Contributor

Yes, I had  just tried that , refrshed and it became true, thanks for the repsonse. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 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.