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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
baneworth
Helper III
Helper III

Problem creating a measure with Filter or Containsstring

Dear all,

 

I created several graphs with different Filters using Calculate(sum(...)) DAX.

For my last graph i have to Filter out several BULK Hours, which is where i am facing a problem.

 

You can think of it as many Productnames (lets call it A,B,C,D,....) and the BULK ID's (PRDSUP-Altus, PRDSUP-Depo, PRDSUP-Flex,....).

 

I have to create a measure where i filter out all of the PRDSUP-***.

 

Current DAX i wrote as follows:

Non Productive Work = CALCULATE(SUM(EmployeeHours[TimeValueHour]),
     Filter(TaskCategory,TaskCategory[CategoryName]="Non-Productive Work" || TaskCategory[CategoryName]="Administrative"),
     FILTER(vwLPR,vwLPR[PRODUCT]<>"PRDSUP-Altus" || vwLPR[PRODUCT]<>"PRDSUP-Depo" || vwLPR[PRODUCT]<>"PRDSUP-         FSeries" || vwLPR[PRODUCT]<>"PRDSUP-Coronus" || vwLPR[PRODUCT]<>"PRDSUP-Upgrade"))/
    CALCULATE(SUM(EmployeeHours[TimeValueHour]))

 

I know that by using Containsstring i can use"PRDSUP*" to get everything related to that, but i can not use <> or maybe -.

Pretty sure there is an easier way to get what i want.

 

Appreciate everyone's time.

 

Best regards

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@baneworth , you can use search, find, containsstring

example of not

calculate( count(Table[value]), filter(Table, not search("A1", [Col1],,0) >0 ))

 

calculate( count(Table[value]), filter(Table, search("A1", [Col1],,0) = 0 ))

 

check : https://www.youtube.com/watch?v=mZt0HJw4gjQ

https://www.youtube.com/watch?v=XbgLGDvWdWQ

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@baneworth , you can use search, find, containsstring

example of not

calculate( count(Table[value]), filter(Table, not search("A1", [Col1],,0) >0 ))

 

calculate( count(Table[value]), filter(Table, search("A1", [Col1],,0) = 0 ))

 

check : https://www.youtube.com/watch?v=mZt0HJw4gjQ

https://www.youtube.com/watch?v=XbgLGDvWdWQ

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for the superfast answer!

 

It worked and i checked both of your Youtube Videos.

 

BR

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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