Forum Discussion
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
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 ))
2 Replies
- amitchandakSuper 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 ))
- baneworthHelper III
Thanks for the superfast answer!
It worked and i checked both of your Youtube Videos.
BR