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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Excluding a value from condition

I am trying to filter out records where the column Device_Name contains = "ESX" or "Appliance". I have this query:

 

IF(NOT(CONTAINS(TableName,Device_Name,"ESX||"Appliance")))

 

The problem is there are values under Device_Name such as Labesx which I don't want filtered out. I just want to filter out device names that just contain the word ESX separately such as (esx-111, esx-222, esxI, rather than being a part of a string such as labesx.

 

How do I accomplish this?

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, i advise using LEFT function.

I create a simple sample to test:

100.PNG

Then create a column to extract specified string like 'esx' or 'Appliance':

 

Column = IF(LEFT('Table'[Device_Name],3)="esx"||LEFT('Table'[Device_Name],9)="Appliance",1,0)

 

Apply a filter about this column to the visual, the result shows:

101.PNG

Hope this helps.

 

Best Regards,

Giotto Zhi

View solution in original post

3 REPLIES 3
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, i advise using LEFT function.

I create a simple sample to test:

100.PNG

Then create a column to extract specified string like 'esx' or 'Appliance':

 

Column = IF(LEFT('Table'[Device_Name],3)="esx"||LEFT('Table'[Device_Name],9)="Appliance",1,0)

 

Apply a filter about this column to the visual, the result shows:

101.PNG

Hope this helps.

 

Best Regards,

Giotto Zhi

Greg_Deckler
Community Champion
Community Champion

Try something like this:

 

Table 2 = 
  FILTER(
      'Table',
      SEARCH("ESX",[Name],1,-1) <> 1 &&
        SEARCH("Appliance",[Name],1,-1) <> 1
  )

 

PBIX attached.

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
JarroVGIT
Resident Rockstar
Resident Rockstar

Make it an AND statement:

 

IF(NOT(CONTAINS(TableName,Device_Name,"ESX")) && NOT(CONTAINS(TableName,Device_Name,"Appliance")), <value for true>, <value for false>)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors