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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Dax with contains and not contains

1231232.png

 

i'm doing it worng =/

 

 

I have to do a SQL query in DAX

 

(text not like '%ORD 9%' and text  not like '%ORD 6%' and text  not like '%Reclassificação%' and text  not like '%TRANSITORIA%' and(text  <> '' or text_cab like '%tarifa%'))

 

Gratz!

1 ACCEPTED SOLUTION

SEARCH("ORD 9", Table[Text], 1, -1) < 0 &&  SEARCH("ORD 6", Table[Text], 1, -1) < 0 && SEARCH("Reclassificação", Table[Text], 1, -1) < 0 && SEARCH("TRANSITORIA", Table[Text], 1, -1) < 0 && (Table[Text] <> "" || SEARCH("tarifa", Table[Text_Cab], 1, -1) > 0)

View solution in original post

3 REPLIES 3
srinivt
Microsoft Employee
Microsoft Employee

CONTAINS function in DAX is for searching a table for a presence of a row when certain search-columns contain the specified values. Think of this as a special version of excel's VLookup function that returns a boolean true or false value, when there is such a row. 

 

You should be using SEARCH or FIND function in DAX for performing text contains check. SEARCH is case-insensitive and FIND is case-sensitive. 

Anonymous
Not applicable

Can You Show me?

I'm a newbie in PBI.

 

Gratz!

SEARCH("ORD 9", Table[Text], 1, -1) < 0 &&  SEARCH("ORD 6", Table[Text], 1, -1) < 0 && SEARCH("Reclassificação", Table[Text], 1, -1) < 0 && SEARCH("TRANSITORIA", Table[Text], 1, -1) < 0 && (Table[Text] <> "" || SEARCH("tarifa", Table[Text_Cab], 1, -1) > 0)

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.